Class InterpHelper

java.lang.Object
codechicken.lib.math.InterpHelper

public class InterpHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    interpolate(double q0, double q1, double q2, double q3)
    Interpolates using the already computed coefficients.
    float
    interpolate(float q0, float q1, float q2, float q3)
    Interpolates using the already computed coefficients.
    void
    locate(double x, double y)
    Computes the coefficients for the interpolation.
    void
    reset(double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
    Resets the interp helper with the given quad.

    Methods inherited from class java.lang.Object

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

    • InterpHelper

      public InterpHelper()
  • Method Details

    • reset

      public void reset(double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
      Resets the interp helper with the given quad. Does not care what order the vertices are in.
    • locate

      public void locate(double x, double y)
      Computes the coefficients for the interpolation.
      Parameters:
      x - X interp location.
      y - Y interp location.
    • interpolate

      public double interpolate(double q0, double q1, double q2, double q3)
      Interpolates using the already computed coefficients.
      Parameters:
      q0 - Value at dx0 dy0
      q1 - Value at dx1 dy1
      q2 - Value at dx2 dy2
      q3 - Value at dx3 dy3
      Returns:
      The result.
    • interpolate

      public float interpolate(float q0, float q1, float q2, float q3)
      Interpolates using the already computed coefficients.
      Parameters:
      q0 - Value at dx0 dy0
      q1 - Value at dx1 dy1
      q2 - Value at dx2 dy2
      q3 - Value at dx3 dy3
      Returns:
      The result.