Constructor
new CubicBezierTuple(start_anchor, first_control, second_control, end_anchor)
Creates a new cubic bezier curve.
Name | Type | Description |
---|---|---|
start_anchor | Point2D | The start anchor of the cubic bezier. |
first_control | Point2D | The first control point of the cubic bezier. |
second_control | Point2D | The second control point of the cubic bezier. |
end_anchor | Point2D | The end anchor of the cubic bezier. |
- Source
Classes
Members
end_anchor
Returns the end anchor of the cubic bezier.
- Source
first_control
Returns the first control point of the cubic bezier.
- Source
second_control
Returns the second control point of the cubic bezier.
- Source
start_anchor
Returns the start anchor of the cubic bezier.
- Source
Methods
clone() → {CubicBezierTuple}
Clones the CubicBezierTuple object.
- Source
- Type:
- CubicBezierTuple
length(samplesopt, extra_lengthopt) → {number}
Returns an approximation of the length of the cubic bezier curve, based on sampling points along the curve and an optional extra length to add.
Name | Type | Attributes | Description |
---|---|---|---|
samples | number | | <optional> | The number of samples to take along the curve. |
extra_length | number | | <optional> | An optional extra length to add to the approximation. |
- Source
- Type:
- number
point_at(t) → {Point2D}
Returns the point on the cubic bezier curve at a given t value.
Name | Type | Description |
---|---|---|
t | number | The t value to evaluate the polynomial at. A number between 0 and 1. |
- Source
The point on the cubic bezier curve when the polynomial is evaluated at the given t value.
- Type:
- Point2D
(static) from_line(p1, p2) → {CubicBezierTuple}
Creates a new cubic bezier curve from a line.
Name | Type | Description |
---|---|---|
p1 | Point2D | The start point of the line. |
p2 | Point2D | The end point of the line. |
- Source
The cubic bezier curve representing the line.
- Type:
- CubicBezierTuple
(static) from_quadratic(p1, p2, p3) → {CubicBezierTuple}
Creates a new cubic bezier curve from a quadratic bezier.
Name | Type | Description |
---|---|---|
p1 | Point2D | The first anchor point of the quadratic bezier. |
p2 | Point2D | The control point of the quadratic bezier. |
p3 | Point2D | The second anchor point of the quadratic bezier. |
- Source
The cubic bezier curve representing the quadratic bezier.
- Type:
- CubicBezierTuple