public class Interpolator extends Object
Constructor and Description |
---|
Interpolator() |
Modifier and Type | Method and Description |
---|---|
static float |
lerp(float a,
float b,
float t)
Linearly interpolate between two floating point numbers.
|
static int |
lerp(int a,
int b,
float t)
Linearly interpolate between two integers.
|
public static float lerp(float a, float b, float t)
a
- the first point in the range where interpolation occurs.b
- the end point in the range where interpolation occurs.t
- the value for the interpolation, it is intended to be in the
closed unit interval [0,1].public static int lerp(int a, int b, float t)
a
- the first point in the range where interpolation occurs.b
- the end point in the range where interpolation occurs.t
- the value for the interpolation, it is intended to be in the
closed unit interval [0,1].Copyright © 2017. All rights reserved.