public class FunctionUtil
extends java.lang.Object
Constructor and Description |
---|
FunctionUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
bezierLengthLin3D(java.util.List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points,
int samples)
Determines the length of a Bezier curve by accumulating linear
interpolations between the specified amount of sample points.
|
static org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
bezierPoint(org.apache.commons.math3.geometry.euclidean.twod.Vector2D p0,
org.apache.commons.math3.geometry.euclidean.twod.Vector2D p1,
float t)
Calculates a point in 2D space that resembles a point on a linear 2D
Bezier curve.
|
static org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
bezierPoint(org.apache.commons.math3.geometry.euclidean.twod.Vector2D p0,
org.apache.commons.math3.geometry.euclidean.twod.Vector2D p1,
org.apache.commons.math3.geometry.euclidean.twod.Vector2D p2,
float t)
Calculates a point in 2D space that resembles a point on a quadratic 2D
Bezier curve.
|
static org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
bezierPoint(org.apache.commons.math3.geometry.euclidean.twod.Vector2D p0,
org.apache.commons.math3.geometry.euclidean.twod.Vector2D p1,
org.apache.commons.math3.geometry.euclidean.twod.Vector2D p2,
org.apache.commons.math3.geometry.euclidean.twod.Vector2D p3,
float t)
Calculates a point in 2D space that resembles a point on a cubic 2D Bezier
curve.
|
static org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
bezierPoint(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1,
float t)
Calculates a point in 3D space that resembles a point on a linear 3D
Bezier curve.
|
static org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
bezierPoint(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2,
float t)
Calculates a point in 3D space that resembles a point on a quadratic 3D
Bezier curve.
|
static org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
bezierPoint(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p3,
float t)
Calculates a point in 3D space that resembles a point on a cubic 3D Bezier
curve.
|
static org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
bezierPoint2D(java.util.List<org.apache.commons.math3.geometry.euclidean.twod.Vector2D> points,
float t)
Calculates a point in 2D space that resembles a point on an 2D Bezier
curve of arbitrary length.
|
static org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
bezierPoint3D(java.util.List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points,
float t)
Calculates a point in 3D space that resembles a point on an 3D Bezier
curve of arbitrary length.
|
static float[] |
bezierPointBA(float[][] currentPoints,
float t)
Calculates a point in nD space that resembles a point on an n-dimensional
Bezier curve of arbitrary length.
|
static org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
bezierPointBA2D(java.util.List<org.apache.commons.math3.geometry.euclidean.twod.Vector2D> points,
float t)
Calculates a point in 2D space that resembles a point on an 2D Bezier
curve of arbitrary length.
|
static org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
bezierPointBA3D(java.util.List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points,
float t)
Calculates a point in 3D space that resembles a point on an 3D Bezier
curve of arbitrary length.
|
static <S extends org.apache.commons.math3.geometry.Space> |
bezierPointGeneric(org.apache.commons.math3.geometry.Vector<S> p0,
org.apache.commons.math3.geometry.Vector<S> p1,
float t)
Calculates a point in 2D/3D space that resembles a point on a linear 2D/3D
Bezier curve.
|
static <S extends org.apache.commons.math3.geometry.Space> |
bezierPointGeneric(org.apache.commons.math3.geometry.Vector<S> p0,
org.apache.commons.math3.geometry.Vector<S> p1,
org.apache.commons.math3.geometry.Vector<S> p2,
float t)
Calculates a point in 2D/3D space that resembles a point on a quadratic
2D/3D Bezier curve.
|
static <S extends org.apache.commons.math3.geometry.Space> |
bezierPointGeneric(org.apache.commons.math3.geometry.Vector<S> p0,
org.apache.commons.math3.geometry.Vector<S> p1,
org.apache.commons.math3.geometry.Vector<S> p2,
org.apache.commons.math3.geometry.Vector<S> p3,
float t)
Calculates a point in 2D/3D space that resembles a point on a cubic 2D/3D
Bezier curve.
|
static double |
sinusPoint(double period,
double amplitude,
double phase,
double offset,
double x)
Calculates a sinus function value.
|
public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D bezierPoint3D(java.util.List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points, float t)
points
- - the list of support pointst
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.twod.Vector2D bezierPoint2D(java.util.List<org.apache.commons.math3.geometry.euclidean.twod.Vector2D> points, float t)
points
- - the list of support pointst
- - the interpolation parameter (0..1)public static float[] bezierPointBA(float[][] currentPoints, float t)
points
- - the list of support pointst
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D bezierPointBA3D(java.util.List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points, float t)
points
- - the list of support pointst
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.twod.Vector2D bezierPointBA2D(java.util.List<org.apache.commons.math3.geometry.euclidean.twod.Vector2D> points, float t)
points
- - the list of support pointst
- - the interpolation parameter (0..1)public static <S extends org.apache.commons.math3.geometry.Space> org.apache.commons.math3.geometry.Vector<S> bezierPointGeneric(org.apache.commons.math3.geometry.Vector<S> p0, org.apache.commons.math3.geometry.Vector<S> p1, float t)
p0
- - the first support pointp1
- - the second support pointt
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D bezierPoint(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1, float t)
p0
- - the first support pointp1
- - the second support pointt
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.twod.Vector2D bezierPoint(org.apache.commons.math3.geometry.euclidean.twod.Vector2D p0, org.apache.commons.math3.geometry.euclidean.twod.Vector2D p1, float t)
p0
- - the first support pointp1
- - the second support pointt
- - the interpolation parameter (0..1)public static <S extends org.apache.commons.math3.geometry.Space> org.apache.commons.math3.geometry.Vector<S> bezierPointGeneric(org.apache.commons.math3.geometry.Vector<S> p0, org.apache.commons.math3.geometry.Vector<S> p1, org.apache.commons.math3.geometry.Vector<S> p2, float t)
p0
- - the first support pointp1
- - the second support pointp2
- - the third support pointt
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D bezierPoint(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2, float t)
p0
- - the first support pointp1
- - the second support pointp2
- - the third support pointt
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.twod.Vector2D bezierPoint(org.apache.commons.math3.geometry.euclidean.twod.Vector2D p0, org.apache.commons.math3.geometry.euclidean.twod.Vector2D p1, org.apache.commons.math3.geometry.euclidean.twod.Vector2D p2, float t)
p0
- - the first support pointp1
- - the second support pointp2
- - the third support pointt
- - the interpolation parameter (0..1)public static <S extends org.apache.commons.math3.geometry.Space> org.apache.commons.math3.geometry.Vector<S> bezierPointGeneric(org.apache.commons.math3.geometry.Vector<S> p0, org.apache.commons.math3.geometry.Vector<S> p1, org.apache.commons.math3.geometry.Vector<S> p2, org.apache.commons.math3.geometry.Vector<S> p3, float t)
p0
- - the first support pointp1
- - the second support pointp2
- - the third support pointp3
- - the forth support pointt
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D bezierPoint(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p3, float t)
p0
- - the first support pointp1
- - the second support pointp2
- - the third support pointp3
- - the forth support pointt
- - the interpolation parameter (0..1)public static org.apache.commons.math3.geometry.euclidean.twod.Vector2D bezierPoint(org.apache.commons.math3.geometry.euclidean.twod.Vector2D p0, org.apache.commons.math3.geometry.euclidean.twod.Vector2D p1, org.apache.commons.math3.geometry.euclidean.twod.Vector2D p2, org.apache.commons.math3.geometry.euclidean.twod.Vector2D p3, float t)
p0
- - the first support pointp1
- - the second support pointp2
- - the third support pointp3
- - the forth support pointt
- - the interpolation parameter (0..1)public static double bezierLengthLin3D(java.util.List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> points, int samples)
points
- - the Bezier curvesamples
- - the amount of sample points. If set to 0, the returned
length is the distance between the start and the end point of the
curve. Every number grater than 0 adds further sample points
between the start and the end point.public static double sinusPoint(double period, double amplitude, double phase, double offset, double x)
period
- - the period of the sinusamplitude
- - the maximum amplitudephase
- - the phase delay of the sinusoffset
- - the offset to the whole functionx
- - the x-coordinate