Class LinearInterpolation
java.lang.Object
com.sk89q.worldedit.math.interpolation.LinearInterpolation
- All Implemented Interfaces:
Interpolation
Simple linear interpolation. Mainly used for testing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublearcLength(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).intgetSegment(double position) Get the segment position.voidSets 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:InterpolationSets nodes to be used by subsequent calls toInterpolation.getPosition(double)and the other methods.- Specified by:
setNodesin interfaceInterpolation- Parameters:
nodes- the nodes
-
getPosition
Description copied from interface:InterpolationGets the result of f(position).- Specified by:
getPositionin interfaceInterpolation- Parameters:
position- the position to interpolate- Returns:
- the result
-
get1stDerivative
Description copied from interface:InterpolationGets the result of f'(position).- Specified by:
get1stDerivativein interfaceInterpolation- Parameters:
position- the position to interpolate- Returns:
- the result
-
arcLength
public double arcLength(double positionA, double positionB) Description copied from interface:InterpolationGets the result of ∫ab|f'(t)| dt.
That means it calculates the arc length (in meters) between positionA and positionB.- Specified by:
arcLengthin interfaceInterpolation- Parameters:
positionA- lower limitpositionB- upper limit- Returns:
- the arc length
-
getSegment
public int getSegment(double position) Description copied from interface:InterpolationGet the segment position.- Specified by:
getSegmentin interfaceInterpolation- Parameters:
position- the position- Returns:
- the segment position
-