|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.math.HermiteSpline
public final class HermiteSpline
Hermite spline A cubic, acceleration-continu spline going fluently through equidistant (with distant 1) interpolation points. The acceleration in these points is calculated using Catmull-Rom: Px'=0.5*(P(x-1)-P(x+1))
| Field Summary | |
|---|---|
private float[] |
interpolationPoints
|
private float |
m0
|
private float |
mn
|
| Constructor Summary | |
|---|---|
HermiteSpline()
Constructor, m0, mn and interpolation points have to be set manually when this zero-argument constructor is used |
|
HermiteSpline(float[] val)
Constructor, speed=0 at start and end points |
|
HermiteSpline(float[] val,
float startSpeed,
float endSpeed)
Constructor |
|
| Method Summary | |
|---|---|
float |
eval(float t)
Get the interpolation value at time t |
static float |
getValue(float t,
float p_1,
float p0,
float p1,
float p2)
Gets the value of the hermite spline at point p0 < t < p1 |
static float |
getValueCustomSpeed(float t,
float p0,
float p1,
float m0,
float m1)
Get the interpolation value for custom speed at interpolation points p0 and p1 |
private static double |
H0(double t)
|
private static double |
H1(double t)
|
private static double |
H2(double t)
|
private static double |
H3(double t)
|
void |
setInterpolationPoints(float[] interpolationPoints)
|
void |
setM0(float m0)
|
void |
setMn(float mn)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private float[] interpolationPoints
private float m0
private float mn
| Constructor Detail |
|---|
public HermiteSpline()
public HermiteSpline(float[] val)
val - points to interpolate through
public HermiteSpline(float[] val,
float startSpeed,
float endSpeed)
val - points to interpolate throughstartSpeed - speed at p0endSpeed - speed at pn| Method Detail |
|---|
private static double H0(double t)
private static double H1(double t)
private static double H2(double t)
private static double H3(double t)
public float eval(float t)
t - time
public static float getValueCustomSpeed(float t,
float p0,
float p1,
float m0,
float m1)
t - time 0<=t<=1p0 - 1st interpolation pointp1 - 2nd interpolation pointm0 - speed at p0m1 - speed at p1
public static float getValue(float t,
float p_1,
float p0,
float p1,
float p2)
t - timep_1 - point p-1p0 - point p0p1 - point p1p2 - point p2
public void setInterpolationPoints(float[] interpolationPoints)
interpolationPoints - The interpolationPoints to set.public void setM0(float m0)
m0 - The m0 to set.public void setMn(float mn)
mn - The mn to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||