Constructors
BezierF
#Create a new bezier segment from four control point coordinates.
BezierF
#Create a new segment from the four control points.
public BezierF()
PointF
p0,
First point.
PointF
p1,
Second point.
PointF
p2,
Third point.
PointF
p3
Fourth point.
BezierF
#Create a new segment which exactly matches a degree=2, 3-point bezier curve.
public BezierF()
PointF
p0,
First point.
PointF
p1,
Second point.
PointF
p2
Third point.
Properties
Length
#Gets the length of this segment. The length is computed to a tolerance of 1e-4, so if you need a more accurate length, you need to scale the curve up first, then divide the resulting length by your scaling factor.
P0
#Gets the first control point of the bezier. This is synonymous with the start of the segment.
public PointF P0 { get; }
P3
#Gets the fourth (and final) control-point of the bezier. This is synonymous with the end of the segment.
public PointF P3 { get; }
Methods
AlignedForm
#Compute the axis aligned bezier segment. This involves moving P0 to (0,0) and rotating the entire segment until the y-coordinate of P3 equals zero.
Returns: Axis aligned bezier.
CanonicalForm
#Compute the canonical bezier form. The canonical form consists of a linear transformation such that P0 ends up at (0,0), P1 ends up at (0,1) and P2 ends up at (1,1). The exact location of P3 can then be used to infer certain properties of the original bezier segment, such as intersections, cusps and inflection count.
Returns: Canonical form.
DistanceFromStart
#Find the parameter on the curve with a certain Euclidean distance from the start.
Extremes
#Solve all parameters along the segment where the x and y coordinates are local extremes.
Inflections
#Compute the inflection parameters for this curve.
Returns: An array of either zero, one or two inflection parameters.
ParameterAtLength
#Gets the bezier parameter at the arc-length. This is approximate.
Project
#Find the parameter on the finite segment closest to the given point.
Returns: Parameter on bezier domain.
Split
#Split this curve into two subcurves.
ToPolyline
#Convert this bezier to an array of points. Regardless of maxError, there will always be points at extremes and inflection points.
public PointF[] ToPolyline()
Returns: Point array.