Class LinearInterpolation

java.lang.Object
com.sk89q.worldedit.math.interpolation.LinearInterpolation
All Implemented Interfaces:
Interpolation

public class LinearInterpolation extends Object implements Interpolation
Simple linear interpolation. Mainly used for testing.
  • Constructor Details

    • LinearInterpolation

      public LinearInterpolation()
  • Method Details

    • setNodes

      public void setNodes(List<Node> nodes)
      Description copied from interface: Interpolation
      Sets nodes to be used by subsequent calls to Interpolation.getPosition(double) and the other methods.
      Specified by:
      setNodes in interface Interpolation
      Parameters:
      nodes - the nodes
    • getPosition

      public Vector3 getPosition(double position)
      Description copied from interface: Interpolation
      Gets the result of f(position).
      Specified by:
      getPosition in interface Interpolation
      Parameters:
      position - the position to interpolate
      Returns:
      the result
    • get1stDerivative

      public Vector3 get1stDerivative(double position)
      Description copied from interface: Interpolation
      Gets the result of f'(position).
      Specified by:
      get1stDerivative in interface Interpolation
      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 interface Interpolation
      Parameters:
      positionA - lower limit
      positionB - 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 interface Interpolation
      Parameters:
      position - the position
      Returns:
      the segment position