Cubic
-
Cmn
open class Cubic
MutableCubic |
This is a Mutable version of |
This class holds the anchor and control point data for a single cubic Bézier curve, with anchor points (anchor0X, anchor0Y) and (anchor1X, anchor1Y) at either end and control points (control0X, control0Y) and (control1X, control1Y) determining the slope of the curve between the anchor points.
Summary
Public companion functions |
||
|---|---|---|
Cubic |
Generates a bezier curve that approximates a circular arc, with p0 and p1 as the starting and ending anchor points. |
Cmn
|
Cubic |
straightLine(x0: Float, y0: Float, x1: Float, y1: Float)Generates a bezier curve that is a straight line between the given anchor points. |
Cmn
|
Public functions |
||
|---|---|---|
operator Cubic |
Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x" |
Cmn
|
operator Cubic |
Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x" |
Cmn
|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
operator Cubic |
Operator overload to enable adding Cubic objects together, like "c0 + c1" |
Cmn
|
Cubic |
reverse()Utility function to reverse the control/anchor points for this curve. |
Cmn
|
Pair<Cubic, Cubic> |
Returns two Cubics, created by splitting this curve at the given distance of |
Cmn
|
operator Cubic |
Operator overload to enable multiplying Cubics by a scalar value x, like "c0 * x" |
Cmn
|
operator Cubic |
Operator overload to enable multiplying Cubics by an Int scalar value x, like "c0 * x" |
Cmn
|
open String |
toString() |
Cmn
|
Cubic |
Transforms the points in this |
Cmn
|
Public properties |
||
|---|---|---|
Float |
The first anchor point x coordinate |
Cmn
|
Float |
The first anchor point y coordinate |
Cmn
|
Float |
The second anchor point x coordinate |
Cmn
|
Float |
The second anchor point y coordinate |
Cmn
|
Float |
The first control point x coordinate |
Cmn
|
Float |
The first control point y coordinate |
Cmn
|
Float |
The second control point x coordinate |
Cmn
|
Float |
The second control point y coordinate |
Cmn
|
Public companion functions
circularArc
fun circularArc(
centerX: Float,
centerY: Float,
x0: Float,
y0: Float,
x1: Float,
y1: Float
): Cubic
Generates a bezier curve that approximates a circular arc, with p0 and p1 as the starting and ending anchor points. The curve generated is the smallest of the two possible arcs around the entire 360-degree circle. Arcs of greater than 180 degrees should use more than one arc together. Note that p0 and p1 should be equidistant from the center.
Public functions
div
operator fun div(x: Float): Cubic
Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x"
div
operator fun div(x: Int): Cubic
Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x"
plus
operator fun plus(o: Cubic): Cubic
Operator overload to enable adding Cubic objects together, like "c0 + c1"
split
fun split(t: Float): Pair<Cubic, Cubic>
Returns two Cubics, created by splitting this curve at the given distance of t between the original starting and ending anchor points.
times
operator fun times(x: Float): Cubic
Operator overload to enable multiplying Cubics by a scalar value x, like "c0 * x"
times
operator fun times(x: Int): Cubic
Operator overload to enable multiplying Cubics by an Int scalar value x, like "c0 * x"
transformed
fun transformed(f: PointTransformer): Cubic
Transforms the points in this Cubic with the given PointTransformer and returns a new Cubic
| Parameters | |
|---|---|
f: PointTransformer |
The |