Class Spline

java.lang.Object
org.jgraph.util.Spline

public class Spline extends Object
Interpolates given values by B-Splines.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Spline(double[] xx, double[] yy)
    Creates a new Spline.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Used to check the correctness of this spline
    double
    getDx(double x)
    Returns the first derivation at x.
    double
    getFastValue(double x)
    Returns an interpolated value.
    double
    getValue(double x)
    Returns an interpolated value.
    void
    setValues(double[] xx, double[] yy)
    Set values for this Spline.
    void
    solve(double[][] A, double[] b)
    Solves Ax=b and stores the solution in b.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Spline

      public Spline(double[] xx, double[] yy)
      Creates a new Spline.
      Parameters:
      xx -
      yy -
  • Method Details

    • setValues

      public void setValues(double[] xx, double[] yy)
      Set values for this Spline.
      Parameters:
      xx -
      yy -
    • getValue

      public double getValue(double x)
      Returns an interpolated value.
      Parameters:
      x -
      Returns:
      the interpolated value
    • getFastValue

      public double getFastValue(double x)
      Returns an interpolated value. To be used when a long sequence of values are required in order, but ensure checkValues() is called beforehand to ensure the boundary checks from getValue() are made
      Parameters:
      x -
      Returns:
      the interpolated value
    • checkValues

      public boolean checkValues()
      Used to check the correctness of this spline
    • getDx

      public double getDx(double x)
      Returns the first derivation at x.
      Parameters:
      x -
      Returns:
      the first derivation at x
    • solve

      public void solve(double[][] A, double[] b)
      Solves Ax=b and stores the solution in b.