public final class InterpolationF extends Object
| Modifier and Type | Method and Description |
|---|---|
static InterpolationFunctionFType |
getCosine() |
static InterpolationFunctionFType |
getExponential() |
static InterpolationFunctionFType |
getLinear() |
static InterpolationFunctionFType |
getLogarithmic() |
static float |
interpolateCosine(float x0,
float x1,
float a)
Interpolate between x0 and x1 based on a such
that:
|
static float |
interpolateExponential(float x0,
float x1,
float factor)
Interpolate between
x0 and x1 based on
factor, using an exponential scale. |
static float |
interpolateLinear(float x0,
float x1,
float a)
Linearly interpolate between x0 and x1 based on
a such that:
|
static float |
interpolateLogarithmic(float x0,
float x1,
float factor)
Interpolate between
x0 and x1 based on
factor, using a logarithmic scale. |
public static InterpolationFunctionFType getCosine()
interpolateCosine(float, float, float).public static InterpolationFunctionFType getExponential()
interpolateExponential(float, float, float).public static InterpolationFunctionFType getLinear()
interpolateLinear(float, float, float).public static InterpolationFunctionFType getLogarithmic()
interpolateLogarithmic(float, float, float).public static float interpolateCosine(float x0,
float x1,
float a)
Interpolate between x0 and x1 based on a such that:
interpolateCosine (x0, x1, 1.0) == x1 interpolateCosine (x0, x1, 0.0) == x0
x0 - The start valuex1 - The end valuea - The interpolation factor in the range [0.0, 1.0]public static float interpolateExponential(float x0,
float x1,
float factor)
x0 and x1 based on
factor, using an exponential scale. When
factor == 0, the function returns x0, when
factor == 1, the function returns x1. More
formally, the function returns x0 + (factor² * (x1 - x0)) .factor - The interpolation factor in the range [0.0, 1.0]x0 - The lower bound.x1 - The upper bound.public static float interpolateLinear(float x0,
float x1,
float a)
Linearly interpolate between x0 and x1 based on a such that:
interpolateLinear (x0, x1, 1.0) == x1 interpolateLinear (x0, x1, 0.0) == x0
x0 - The start valuex1 - The end valuea - The interpolation factor in the range [0.0, 1.0]public static float interpolateLogarithmic(float x0,
float x1,
float factor)
x0 and x1 based on
factor, using a logarithmic scale. When
factor == 0, the function returns x0, when
factor == 1, the function returns x1. More
formally, the function returns
x0 + (sqrt(factor) * (x1 - x0)) .factor - The interpolation factor in the range [0.0, 1.0]x0 - The lower bound.x1 - The upper bound.Copyright © 2014 <code@io7m.com> http://io7m.com