hmi.math
Class TCBSpline

java.lang.Object
  extended by hmi.math.TCBSpline

public class TCBSpline
extends Object

TCB spline A non-uniform spline with tensity, continuity and bias controls C1 continous, interpolates the points {link http://hmi.ewi.utwente.nl/aigaion/?page=publication&kind=single&ID=358}

Author:
Herwin van Welbergen

Field Summary
private  float[] bias
           
private  float[] continuity
           
private  float[] interpolationPoints
           
private  float[] interpolationTimes
           
private  float m0
           
private  float mn
           
private  float[] tension
           
 
Constructor Summary
TCBSpline()
          Constructor, m0, mn and interpolation points have to be set manually when this zero-argument constructor is used
TCBSpline(float[] val, float[] time, float[] t, float[] c, float[] b, float startSpeed, float endSpeed)
          Constructor
 
Method Summary
 float eval(float t)
          Get the interpolation value at time t
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 setBias(float[] bias)
           
 void setContinuity(float[] continuity)
           
 void setInterpolationPoints(float[] interpolationPoints)
           
 void setInterpolationTimes(float[] interpolationTimes)
           
 void setM0(float m0)
           
 void setMn(float mn)
           
 void setTension(float[] tension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interpolationPoints

private float[] interpolationPoints

interpolationTimes

private float[] interpolationTimes

tension

private float[] tension

continuity

private float[] continuity

bias

private float[] bias

m0

private float m0

mn

private float mn
Constructor Detail

TCBSpline

public TCBSpline()
Constructor, m0, mn and interpolation points have to be set manually when this zero-argument constructor is used


TCBSpline

public TCBSpline(float[] val,
                 float[] time,
                 float[] t,
                 float[] c,
                 float[] b,
                 float startSpeed,
                 float endSpeed)
Constructor

Parameters:
val - interpolation points
time - interpolation times
t - tension
c - continuity
b - bias
startSpeed - start speed
endSpeed - end speed
Method Detail

h0

private static double h0(double t)

h1

private static double h1(double t)

h2

private static double h2(double t)

h3

private static double h3(double t)

eval

public float eval(float t)
Get the interpolation value at time t

Parameters:
t - time
Returns:
the interpolation value, interpolationPoints[interpolationPoints.length-1] if t >= interpolationPoints.length-1

getValueCustomSpeed

public 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

Parameters:
t - time 0<=t<=1
p0 - 1st interpolation point
p1 - 2nd interpolation point
m0 - speed at p0
m1 - speed at p1
Returns:
the interpolation value

setInterpolationPoints

public void setInterpolationPoints(float[] interpolationPoints)
Parameters:
interpolationPoints - The interpolationPoints to set.

setM0

public void setM0(float m0)
Parameters:
m0 - The m0 to set.

setMn

public void setMn(float mn)
Parameters:
mn - The mn to set.

setBias

public void setBias(float[] bias)
Parameters:
bias - the bias to set

setContinuity

public void setContinuity(float[] continuity)
Parameters:
continuity - the continuity to set

setInterpolationTimes

public void setInterpolationTimes(float[] interpolationTimes)
Parameters:
interpolationTimes - the interpolationTimes to set

setTension

public void setTension(float[] tension)
Parameters:
tension - the tension to set