public final class InterpolationD extends Object
| Modifier and Type | Method and Description |
|---|---|
static InterpolationFunctionDType |
getCosine() |
static InterpolationFunctionDType |
getExponential() |
static InterpolationFunctionDType |
getLinear() |
static InterpolationFunctionDType |
getLogarithmic() |
static double |
interpolateCosine(double x0,
double x1,
double factor)
Interpolate between x0 and x1 based on factor
such that:
|
static double |
interpolateExponential(double x0,
double x1,
double factor)
Interpolate between
x0 and x1 based on
factor, using an exponential scale. |
static double |
interpolateLinear(double x0,
double x1,
double factor)
Linearly interpolate between x0 and x1 based on
factor such that:
|
static double |
interpolateLogarithmic(double x0,
double x1,
double factor)
Interpolate between
x0 and x1 based on
factor, using an exponential scale. |
public static InterpolationFunctionDType getCosine()
interpolateCosine(double, double, double).public static InterpolationFunctionDType getExponential()
interpolateExponential(double, double, double).public static InterpolationFunctionDType getLinear()
interpolateLinear(double, double, double).public static InterpolationFunctionDType getLogarithmic()
interpolateLogarithmic(double, double, double).public static double interpolateCosine(double x0,
double x1,
double factor)
Interpolate between x0 and x1 based on factor such that:
interpolateCosine (x0, x1, 1.0) == x1 interpolateCosine (x0, x1, 0.0) == x0
x0 - The start valuex1 - The end valuefactor - The interpolation factorpublic static double interpolateExponential(double x0,
double x1,
double 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 double interpolateLinear(double x0,
double x1,
double factor)
Linearly interpolate between x0 and x1 based on factor such that:
interpolateLinear (x0, x1, 1.0) == x1 interpolateLinear (x0, x1, 0.0) == x0
x0 - The start valuex1 - The end valuefactor - The interpolation factorpublic static double interpolateLogarithmic(double x0,
double x1,
double 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 + (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