v4.3

Curve in two-dimensional space. More...

Public Member Functions

self Shift (number dx, number dy)
 Shifts the curve by the specified values ​​along the coordinate axes.
self Shift (Vector2D vector)
 Shifts the curve by vector.
self Rotate (Point2D point, number angle)
 Rotates the curve around 'point' by 'angle'.
self Scale (Point2D point, number xScale, number yScale)
 Scales the curve along two axes relative to a fixed point.
self Transform (Matrix2D matrix)
 Transform according to the matrix.
Curve2D Clone ()
 Returns a copy of the curve.
self Invert ()
 Inverts the direction of the curve.
Point2D GetStartPoint ()
 Returns the start point of the curve.
Point2D GetEndPoint ()
 Returns the end point of the curve.
BoundingRect GetBounds ()
 Returns the curve bounding rectangle.
self Trim (Point2D startPoint, Point2D endPoint)
 Trims the curve by two points.
boolean operator== (Curve2D other)
 Checks for equality.
boolean operator~= (Curve2D other)
 Checks for inequality.
Vector2D GetTangent (Point2D point)
 Calculates the tangent vector at a given point.
number GetLength ()
 Returns the length of the curve.
Point2D GetPointAtDistance (number distance)
 Returns the point on the curve at a given distance from the start point.
boolean IsClosed ()
 Checks if the curve is closed.
self Extend (EndType endType, number length)
 Extends the curve by the specified length.
Point2D GetPointProjection (Point2D point, boolean oExtension)
 Returns an orthogonal projection of the point to the curve. If there is more than one orthogonal point projection, the closest one is returned. If there is more than one projection at the same distance, the one closest to the start of the curve is returned.

Detailed Description

Curve in two-dimensional space.

Member Function Documentation

◆ Extend()

self Extend ( EndType endType,
number length )

Extends the curve by the specified length.

Parameters
endTypeCurve end to extend. Acceptable values: EndType.Start, EndType.End.
lengthLength by which the curve will be extended.
Since
v4.3

◆ GetLength()

number GetLength ( )

Returns the length of the curve.

Since
v4.3

◆ GetPointAtDistance()

Point2D GetPointAtDistance ( number distance)

Returns the point on the curve at a given distance from the start point.

Parameters
distanceThe distance along the curve.
Since
v4.3

◆ GetPointProjection()

Point2D GetPointProjection ( Point2D point,
boolean oExtension )

Returns an orthogonal projection of the point to the curve. If there is more than one orthogonal point projection, the closest one is returned. If there is more than one projection at the same distance, the one closest to the start of the curve is returned.

Parameters
oExtension[opt] true - returns the projection to the extended curve. false - returns the projection to the initial curve. Default value is false.
Since
v4.3

◆ GetTangent()

Vector2D GetTangent ( Point2D point)

Calculates the tangent vector at a given point.

Parameters
pointPoint on curve.
Since
v4.3

◆ IsClosed()

boolean IsClosed ( )

Checks if the curve is closed.

Since
v4.3

◆ Rotate()

self Rotate ( Point2D point,
number angle )

Rotates the curve around 'point' by 'angle'.

Parameters
pointCenter of rotation.
angleThe angle in radians.

◆ Shift()

self Shift ( Vector2D vector)

Shifts the curve by vector.

Since
v4.2