Sign in Join
FPDoc Onlineexperiment

GraphMath unit

A set of mathematical helper routines to simply cross-platform canvas drawing.

graphmath.pp contains math helper routines for use for graphics drawing. It is used to simply cross-platform canvas drawing operations. graphmath.pp is part of the LazUtils package.

Classes and records

TFloatPointrecordTFloatPoint is an extended precision record specifying the X and Y coordinates of a point in a graphic environment.

Procedures and functions

add(Extended,TFloatPoint):TFloatPointoperator
add(TFloatPoint,Extended):TFloatPointoperator
add(TFloatPoint,TFloatPoint):TFloatPointoperator
add(TFloatPoint,TPoint):TFloatPointoperator
add(TPoint,TFloatPoint):TFloatPointoperator
Angles2CoordsprocedureConverts an Eccentric Angle and an Angle-Length, into the coordinates for the Start and End radial Points.
Arc2BezierprocedureConverts an Arc and ArcLength into a Bezier Approximation of the Arc.
Arc2PolyBezierprocedureApproximates an elliptical arc by an array of Bezier segments consisting of curve and control points.
assign(TFloatPoint):TPointoperator
assign(TPoint):TFloatPointoperator
BezierfunctionGets a TBezier instance representing the specified Bezier control points.
Bezier2PolylineprocedureBezier2Polyline - convert a 4-Point Bezier into a Pointer Array of TPoint and a Count variable.
BezierArcPointsprocedureConverts an Arc and ArcLength into a Pointer to an Array of TPoints for use with Polyline or Polygon.
BezierMidPointfunctionBezierMidPoint - get the Mid-Point of any 4-Point Bezier. It is primarily for use in SplitBezier.
CalculateLeftTopWidthHeightprocedureCalculates the values for the output variables in Left, Top, Width, and Height.
Coords2AnglesprocedureCoords2Angles - convert the coords for Start and End Radial- Points into an Eccentric counter clockwise Angle and an Angle-Length.
DistancefunctionGets the distance between two points, or the distance of a point from a specified line.
divide(TFloatPoint,Extended):TFloatPointoperator
divide(TFloatPoint,TFloatPoint):TFloatPointoperator
divide(TFloatPoint,TPoint):TFloatPointoperator
divide(TPoint,TFloatPoint):TFloatPointoperator
EccentricAnglefunctionEccentricAngle - get the Eccentric Angle of a given point on any non-rotated ellipse.
EllipsePolygonfunctionGets an array of points for a polygon which approximates an ellipse in the specified rectangle.
EllipseRadialLengthfunctionEllipseRadialLength - Radial-Length of non-rotated ellipse at any given Eccentric Angle.
EllipseRadialLengthFromPolarAnglefunction
equal(TFloatPoint,TFloatPoint):Booleanoperator
equal(TPoint,TPoint):Booleanoperator
equal(TRect,TRect):Booleanoperator
FloatPointfunctionFloatPoint - it is essentially like Classes.Point in use, except that it accepts Extended Parameters. It is Primarily for use with and in Bezier routines.
LineEndPointfunctionLineEndPoint - get the End-Point of a line of any given Length at any given angle with any given Start-Point.
MakeMinMaxprocedureEnsures that the i1 argument is the smaller of the two Integer values.
MoveRectprocedureMoves the specified rectangle to the origin in the x and y arguments.
MoveRectToFitprocedureMoves and potentially resizes a rectangle to fit within the specified target rectangle.
multiply(Extended,TFloatPoint):TFloatPointoperator
multiply(TFloatPoint,Extended):TFloatPointoperator
multiply(TFloatPoint,TFloatPoint):TFloatPointoperator
multiply(TFloatPoint,TPoint):TFloatPointoperator
multiply(TPoint,TFloatPoint):TFloatPointoperator
PolyBezier2PolylineprocedurePolyBezier2Polyline - convert an array of 4-Point Bezier into a Pointer Array of TPoint and a Count variable.
PolyBezierArcPointsprocedurePolyBezierArcPoints - convert an Arc and ArcLength into a Pointer Array of TPoints for use with Polyline or Polygon.
QuadrantfunctionDetermine the Quadrant of any point, given the Center.
RadialPointfunctionGet the RadialPoint at any given Eccentric angle on any non- rotated ellipse.
RotatePointfunctionRotates a point around the origin by the specified angle (in radians).
RotateRectfunctionRotates a rectangle with the specified dimensions by the specified angle (in radians).
SameRectfunctionIndicates whether member in the specified rectangles have the same values.
SplitBezierprocedureSplitBezier - split any 4-Point Bezier into two 4-Point Beziers: a 'Left' and a 'Right'
subtract(TFloatPoint,Extended):TFloatPointoperator
subtract(TFloatPoint,TFloatPoint):TFloatPointoperator
subtract(TFloatPoint,TPoint):TFloatPointoperator
subtract(TPoint,TFloatPoint):TFloatPointoperator

Types

PPointtypePointer to the TPoint type.
TBeziertypeArray type used to store the coordinates for Bezier control points as floating point values.
TBezierPointArraytypeDynamically-sized array used to store TFloatPoint instances.

Topics

GraphMathOperatorstopicGraphMath Operators.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.