Cubic.Companion


public static class Cubic.Companion


Summary

Public methods

static final @NonNull Cubic
@<Error class: unknown class>
circularArc(
    float centerX,
    float centerY,
    float x0,
    float y0,
    float x1,
    float y1
)

Generates a bezier curve that approximates a circular arc, with p0 and p1 as the starting and ending anchor points.

static final @NonNull Cubic
@<Error class: unknown class>
straightLine(float x0, float y0, float x1, float y1)

Generates a bezier curve that is a straight line between the given anchor points.

Public methods

circularArc

Added in 1.0.0-alpha05
@<Error class: unknown class>
public static final @NonNull Cubic circularArc(
    float centerX,
    float centerY,
    float x0,
    float y0,
    float x1,
    float y1
)

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.

straightLine

Added in 1.0.0-alpha05
@<Error class: unknown class>
public static final @NonNull Cubic straightLine(float x0, float y0, float x1, float y1)

Generates a bezier curve that is a straight line between the given anchor points. The control points lie 1/3 of the distance from their respective anchor points.