Package codechicken.lib.math
Class InterpHelper
java.lang.Object
codechicken.lib.math.InterpHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleinterpolate(double q0, double q1, double q2, double q3) Interpolates using the already computed coefficients.floatinterpolate(float q0, float q1, float q2, float q3) Interpolates using the already computed coefficients.voidlocate(double x, double y) Computes the coefficients for the interpolation.voidreset(double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3) Resets the interp helper with the given quad.
-
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 dy0q1- Value at dx1 dy1q2- Value at dx2 dy2q3- 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 dy0q1- Value at dx1 dy1q2- Value at dx2 dy2q3- Value at dx3 dy3- Returns:
- The result.
-