@Test public void testInterpolateLinear7() { final float scale = 0.0f; final Vector3f startValue = new Vector3f(1.4013e-45f, 0.0f, 0.0f); final Vector3f endValue = new Vector3f(0.0f, 0.0f, 0.0f); final Vector3f store = new Vector3f(0.0f, 0.0f, 0.0f); final Vector3f retval = FastMath.interpolateLinear(scale, startValue, endValue, store); assertEquals(store, retval); assertNotNull(store); assertEquals(1.4013e-45f, store.getX(), 0.0f); assertEquals(0.0f, store.getY(), 0.0f); assertEquals(0.0f, store.getZ(), 0.0f); assertNotNull(retval); assertEquals(1.4013e-45f, retval.getX(), 0.0f); assertEquals(0.0f, retval.getY(), 0.0f); assertEquals(0.0f, retval.getZ(), 0.0f); }
public static float interpolateLinear(float scale, float startValue, float endValue) { if (startValue == endValue) { return startValue; } if (scale <= 0f) { return startValue; } if (scale >= 1f) { return endValue; } return ((1f - scale) * startValue) + (scale * endValue); }
FastMath { public static float interpolateLinear(float scale, float startValue, float endValue) { if (startValue == endValue) { return startValue; } if (scale <= 0f) { return startValue; } if (scale >= 1f) { return endValue; } return ((1f - scale) * startValue) + (scale * endValue); } }
FastMath { public static float interpolateLinear(float scale, float startValue, float endValue) { if (startValue == endValue) { return startValue; } if (scale <= 0f) { return startValue; } if (scale >= 1f) { return endValue; } return ((1f - scale) * startValue) + (scale * endValue); } private  FastMath(); }
FastMath { public static float interpolateLinear(float scale, float startValue, float endValue) { if (startValue == endValue) { return startValue; } if (scale <= 0f) { return startValue; } if (scale >= 1f) { return endValue; } return ((1f - scale) * startValue) + (scale * endValue); } private  FastMath(); static boolean isPowerOfTwo(int number); static int nearestPowerOfTwo(int number); static float interpolateLinear(float scale, float startValue, float endValue); static Vector3f interpolateLinear(float scale, Vector3f startValue,
            Vector3f endValue, Vector3f store); static Vector3f interpolateLinear(float scale, Vector3f startValue, Vector3f endValue); static float extrapolateLinear(float scale, float startValue, float endValue); static Vector3f extrapolateLinear(float scale, Vector3f startValue,
            Vector3f endValue, Vector3f store); static Vector3f extrapolateLinear(float scale, Vector3f startValue, Vector3f endValue); static float interpolateCatmullRom(float u, float T, float p0, float p1, float p2, float p3); static Vector3f interpolateCatmullRom(float u, float T, Vector3f p0,
            Vector3f p1, Vector3f p2, Vector3f p3, Vector3f store); static Vector3f interpolateCatmullRom(float u, float T, Vector3f p0,
            Vector3f p1, Vector3f p2, Vector3f p3); static float interpolateBezier(float u, float p0, float p1, float p2, float p3); static Vector3f interpolateBezier(float u, Vector3f p0, Vector3f p1,
            Vector3f p2, Vector3f p3, Vector3f store); static Vector3f interpolateBezier(float u, Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3); static float getCatmullRomP1toP2Length(Vector3f p0, Vector3f p1,
            Vector3f p2, Vector3f p3, float startRange, float endRange, float curveTension); static float getBezierP1toP2Length(Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3); static float acos(float fValue); static float asin(float fValue); static float atan(float fValue); static float atan2(float fY, float fX); static float ceil(float fValue); static float cos(float v); static float sin(float v); static float exp(float fValue); static float abs(float fValue); static float floor(float fValue); static float invSqrt(float fValue); static float fastInvSqrt(float x); static float log(float fValue); static float log(float value, float base); static float pow(float fBase, float fExponent); static float sqr(float fValue); static float sqrt(float fValue); static float tan(float fValue); static int sign(int iValue); static float sign(float fValue); static int counterClockwise(Vector2f p0, Vector2f p1, Vector2f p2); static int pointInsideTriangle(Vector2f t0, Vector2f t1, Vector2f t2, Vector2f p); static Vector3f computeNormal(Vector3f v1, Vector3f v2, Vector3f v3); static float determinant(double m00, double m01, double m02,
            double m03, double m10, double m11, double m12, double m13,
            double m20, double m21, double m22, double m23, double m30,
            double m31, double m32, double m33); static float nextRandomFloat(); static int nextRandomInt(int min, int max); static int nextRandomInt(); static Vector3f sphericalToCartesian(Vector3f sphereCoords,
            Vector3f store); static Vector3f cartesianToSpherical(Vector3f cartCoords,
            Vector3f store); static Vector3f sphericalToCartesianZ(Vector3f sphereCoords,
            Vector3f store); static Vector3f cartesianZToSpherical(Vector3f cartCoords,
            Vector3f store); static float normalize(float val, float min, float max); static float copysign(float x, float y); static float clamp(float input, float min, float max); static float saturate(float input); static boolean approximateEquals(float a, float b); static float convertHalfToFloat(short half); static short convertFloatToHalf(float flt); static float unInterpolateLinear(float value, float min, float max); }
FastMath { public static float interpolateLinear(float scale, float startValue, float endValue) { if (startValue == endValue) { return startValue; } if (scale <= 0f) { return startValue; } if (scale >= 1f) { return endValue; } return ((1f - scale) * startValue) + (scale * endValue); } private  FastMath(); static boolean isPowerOfTwo(int number); static int nearestPowerOfTwo(int number); static float interpolateLinear(float scale, float startValue, float endValue); static Vector3f interpolateLinear(float scale, Vector3f startValue,
            Vector3f endValue, Vector3f store); static Vector3f interpolateLinear(float scale, Vector3f startValue, Vector3f endValue); static float extrapolateLinear(float scale, float startValue, float endValue); static Vector3f extrapolateLinear(float scale, Vector3f startValue,
            Vector3f endValue, Vector3f store); static Vector3f extrapolateLinear(float scale, Vector3f startValue, Vector3f endValue); static float interpolateCatmullRom(float u, float T, float p0, float p1, float p2, float p3); static Vector3f interpolateCatmullRom(float u, float T, Vector3f p0,
            Vector3f p1, Vector3f p2, Vector3f p3, Vector3f store); static Vector3f interpolateCatmullRom(float u, float T, Vector3f p0,
            Vector3f p1, Vector3f p2, Vector3f p3); static float interpolateBezier(float u, float p0, float p1, float p2, float p3); static Vector3f interpolateBezier(float u, Vector3f p0, Vector3f p1,
            Vector3f p2, Vector3f p3, Vector3f store); static Vector3f interpolateBezier(float u, Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3); static float getCatmullRomP1toP2Length(Vector3f p0, Vector3f p1,
            Vector3f p2, Vector3f p3, float startRange, float endRange, float curveTension); static float getBezierP1toP2Length(Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3); static float acos(float fValue); static float asin(float fValue); static float atan(float fValue); static float atan2(float fY, float fX); static float ceil(float fValue); static float cos(float v); static float sin(float v); static float exp(float fValue); static float abs(float fValue); static float floor(float fValue); static float invSqrt(float fValue); static float fastInvSqrt(float x); static float log(float fValue); static float log(float value, float base); static float pow(float fBase, float fExponent); static float sqr(float fValue); static float sqrt(float fValue); static float tan(float fValue); static int sign(int iValue); static float sign(float fValue); static int counterClockwise(Vector2f p0, Vector2f p1, Vector2f p2); static int pointInsideTriangle(Vector2f t0, Vector2f t1, Vector2f t2, Vector2f p); static Vector3f computeNormal(Vector3f v1, Vector3f v2, Vector3f v3); static float determinant(double m00, double m01, double m02,
            double m03, double m10, double m11, double m12, double m13,
            double m20, double m21, double m22, double m23, double m30,
            double m31, double m32, double m33); static float nextRandomFloat(); static int nextRandomInt(int min, int max); static int nextRandomInt(); static Vector3f sphericalToCartesian(Vector3f sphereCoords,
            Vector3f store); static Vector3f cartesianToSpherical(Vector3f cartCoords,
            Vector3f store); static Vector3f sphericalToCartesianZ(Vector3f sphereCoords,
            Vector3f store); static Vector3f cartesianZToSpherical(Vector3f cartCoords,
            Vector3f store); static float normalize(float val, float min, float max); static float copysign(float x, float y); static float clamp(float input, float min, float max); static float saturate(float input); static boolean approximateEquals(float a, float b); static float convertHalfToFloat(short half); static short convertFloatToHalf(float flt); static float unInterpolateLinear(float value, float min, float max); static final double DBL_EPSILON; static final float FLT_EPSILON; static final float ZERO_TOLERANCE; static final float ONE_THIRD; static final float PI; static final float TWO_PI; static final float HALF_PI; static final float QUARTER_PI; static final float INV_PI; static final float INV_TWO_PI; static final float DEG_TO_RAD; static final float RAD_TO_DEG; static final Random rand; }