Class LinearInterpolation
java.lang.Object
com.sk89q.worldedit.math.interpolation.LinearInterpolation
- All Implemented Interfaces:
Interpolation
Simple linear interpolation. Mainly used for testing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
arcLength
(double positionA, double positionB) Gets the result of ∫ab|f'(t)| dt.
That means it calculates the arc length (in meters) between positionA and positionB.get1stDerivative
(double position) Gets the result of f'(position).getPosition
(double position) Gets the result of f(position).int
getSegment
(double position) Get the segment position.void
Sets nodes to be used by subsequent calls toInterpolation.getPosition(double)
and the other methods.
-
Constructor Details
-
LinearInterpolation
public LinearInterpolation()
-
-
Method Details
-
setNodes
Description copied from interface:Interpolation
Sets nodes to be used by subsequent calls toInterpolation.getPosition(double)
and the other methods.- Specified by:
setNodes
in interfaceInterpolation
- Parameters:
nodes
- the nodes
-
getPosition
Description copied from interface:Interpolation
Gets the result of f(position).- Specified by:
getPosition
in interfaceInterpolation
- Parameters:
position
- the position to interpolate- Returns:
- the result
-
get1stDerivative
Description copied from interface:Interpolation
Gets the result of f'(position).- Specified by:
get1stDerivative
in interfaceInterpolation
- Parameters:
position
- the position to interpolate- Returns:
- the result
-
arcLength
public double arcLength(double positionA, double positionB) Description copied from interface:Interpolation
Gets the result of ∫ab|f'(t)| dt.
That means it calculates the arc length (in meters) between positionA and positionB.- Specified by:
arcLength
in interfaceInterpolation
- Parameters:
positionA
- lower limitpositionB
- upper limit- Returns:
- the arc length
-
getSegment
public int getSegment(double position) Description copied from interface:Interpolation
Get the segment position.- Specified by:
getSegment
in interfaceInterpolation
- Parameters:
position
- the position- Returns:
- the segment position
-