public class SinFunction extends SupportPointFunction
SupportPointFunction.SupportPointComperator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SIN_NAME
name identifying a sine function
|
Constructor and Description |
---|
SinFunction()
Default Constructor.
|
SinFunction(java.util.ArrayList<SupportPoint> points,
float stiffness)
Construct a new SinFunction from 3 special SupportPoints.
|
SinFunction(float period,
float amplitude,
float phaseShift,
float offset,
float stiffness)
Construct a new SinFunction with the given properties.
|
SinFunction(SinFunction source)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
IFunction |
copy() |
java.lang.String |
getName()
Get Function name
|
float[] |
getSinParameters() |
void |
initialize()
Called after changes to support points.
|
org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
moveSupportPointTo(int index,
float x,
float y) |
org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
moveTangentPointAfterTo(int index,
float x,
float y) |
org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
moveTangentPointBeforeTo(int index,
float x,
float y) |
double |
value(double t)
Returns the function value at the passed x coordinate.
|
addSupportPoint, getDefinitionRange, getMaxX, getMaxY, getMinX, getMinY, getStiffness, getSupportPoint, getSupportPointsInArea, getSupportPointSize, hasSupportPointInArea, hasSupportPointsInArea, indexOf, mirrorYFunction, moveFunction, moveSupportPoint, moveSupportPoint, moveSupportPointTo, removeSupportPoint, rescaleXRange, toCSVString
public static final java.lang.String SIN_NAME
public SinFunction()
public SinFunction(java.util.ArrayList<SupportPoint> points, float stiffness)
points
- - a list of 3 special SupportPoints representing a sinus
functionpublic SinFunction(float period, float amplitude, float phaseShift, float offset, float stiffness)
period
- - the periodamplitude
- - the amplitudephaseShift
- - the phase shiftyOffset
- - the offset in Y-directionpublic SinFunction(SinFunction source)
source
- The source object to copypublic java.lang.String getName()
public double value(double t)
IFunction
t
- the coordinate at which to return the functions valuepublic org.apache.commons.math3.geometry.euclidean.twod.Vector2D moveSupportPointTo(int index, float x, float y)
moveSupportPointTo
in interface IFunction
moveSupportPointTo
in class SupportPointFunction
index
- - the index of the SupportPoint to movex
- - the new x coordinate of the SupportPointy
- - the new y coordinate of the SupportPointpublic void initialize()
SupportPointFunction
initialize
in class SupportPointFunction
public IFunction copy()
public float[] getSinParameters()
public org.apache.commons.math3.geometry.euclidean.twod.Vector2D moveTangentPointBeforeTo(int index, float x, float y)
moveTangentPointBeforeTo
in interface IFunction
moveTangentPointBeforeTo
in class SupportPointFunction
index
- - the index of the SupportPoint which tangent point before
should be movedx
- - the new x coordinate of the SupportPoint tangent point beforey
- - the new y coordinate of the SupportPoint tangent point beforepublic org.apache.commons.math3.geometry.euclidean.twod.Vector2D moveTangentPointAfterTo(int index, float x, float y)
moveTangentPointAfterTo
in interface IFunction
moveTangentPointAfterTo
in class SupportPointFunction
index
- - the index of the SupportPoint which tangent point after
should be movedx
- - the new x coordinate of the SupportPoint tangent point aftery
- - the new y coordinate of the SupportPoint tangent point after