public class CurveUtils
extends java.lang.Object
Constructor and Description |
---|
CurveUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
interpolate(double p0,
double p1,
double p2,
double p3,
double t)
Interpolation of Catmull-Rom Spline
|
static double |
tangentCubicBezier(double t,
double p0,
double p1,
double p2,
double p3)
This method calculates tangent of Cubic Bezier Curve.
|
static double |
tangentQuadraticBezier(double t,
double p0,
double p1,
double p2)
This method calculates tangent of Quadratic Bezier Curve.
|
static double |
tangentSpline(double t,
double p0,
double p1,
double p2,
double p3)
This method calculates tangent of Spline Curve.
|
public static double tangentQuadraticBezier(double t, double p0, double p1, double p2)
t
- the value in range <0.0, 1.0>. The t in the
function for a linear Bezier curve can be
thought of as describing how far B(t) is from p0 to p2.p0
- the p0 Quadratic Bezier Curve point.p1
- the p1 Quadratic Bezier Curve point.p2
- the p2 Quadratic Bezier Curve point.public static double tangentCubicBezier(double t, double p0, double p1, double p2, double p3)
t
- the value in range <0.0, 1.0>. The t in the
function for a linear Bezier curve can be
thought of as describing how far B(t) is from p0 to p3.p0
- the p0 Cubic Bezier Curve point.p1
- the p1 Cubic Bezier Curve point.p2
- the p2 Cubic Bezier Curve point.p3
- the p3 Cubic Bezier Curve point.public static double tangentSpline(double t, double p0, double p1, double p2, double p3)
t
- the value in range <0.0, 1.0>. The t in the
function for a linear Bezier curve can be
thought of as describing how far B(t) is from p0 to p3.p0
- the p0 Spline point.p1
- the p1 Spline point.p2
- the p2 Spline point.p3
- the p3 Spline point.public static double interpolate(double p0, double p1, double p2, double p3, double t)
p0
- the p0 Spline point.p1
- the p1 Spline point.p2
- the p2 Spline point.p3
- the p3 Spline point.t
- the value in range <0.0, 1.0>. The t in the
function for a linear Bezier curve can be
thought of as describing how far B(t) is from p0 to p3.