CubicBezierSegment
class CubicBezierSegment extends PolynomialSegment
A spline segment representing a cubic Bézier curve.
Constructors
constructor
Parameters
OverwritesPolynomialSegment.constructorProperties
p0
p1
p2
p3
Accessors
arcLength
public get arcLength(): number
PolynomialSegment.arcLengthpoints
public get override points(): Vector2[]
PolynomialSegment.pointsMethods
draw
Parameters
Inherited fromPolynomialSegment.draweval
public evalt: number: CurvePoint
Evaluate the polynomial at the given t value.
Parameters
t: numberThe t value at which to evaluate the curve.
PolynomialSegment.evalgetBBox
public getBBox(): BBox
PolynomialSegment.getBBoxgetPoint
public getPointdistance: number: CurvePoint
Parameters
distance: number
PolynomialSegment.getPointsplit
public override splitt: number: PolynomialSegmentPolynomialSegment
Split the curve into two separate polynomials at the given t value. The two resulting curves form the same overall shape as the original curve.
Parameters
t: numberThe t value at which to split the curve.
PolynomialSegment.splittangent
Return the tangent of the point that sits at the provided t value on the curve.
Parameters
t: numberThe t value at which to evaluate the curve.
PolynomialSegment.tangenttoSVGCommands
Convert this segment to SVG path commands.
Parameters
start: number = 0Start distance along the segment (0 to arcLength)
end: number = 1End distance along the segment (0 to arcLength)
move: boolean = trueWhether to include a moveTo command at the start
PolynomialSegment.toSVGCommandstransformPoints
Parameters
Inherited fromPolynomialSegment.transformPoints