MathHelper
Added in 1.0.0-beta01
public final class MathHelper
Summary
Public methods |
|
|---|---|
static final float |
clamp(float x, float min, float max)Clamps a value. |
static final float |
lerp(float a, float b, float t)Linearly interpolates between two values. |
static final float |
toDegrees(float angleInRadians)Converts |
static final float |
toRadians(float angleInDegrees)Converts |
Public methods
clamp
public static final float clamp(float x, float min, float max)
Clamps a value.
| Parameters | |
|---|---|
float x |
the value to clamp |
float min |
the minimum value |
float max |
the maximum value |
lerp
public static final float lerp(float a, float b, float t)
Linearly interpolates between two values.
| Parameters | |
|---|---|
float a |
the start value |
float b |
the end value |
float t |
the ratio between the two floats |
toDegrees
public static final float toDegrees(float angleInRadians)
Converts angleInRadians from radians to degrees.
| Parameters | |
|---|---|
float angleInRadians |
the angle in radians |
toRadians
public static final float toRadians(float angleInDegrees)
Converts angleInDegrees from degrees to radians.
| Parameters | |
|---|---|
float angleInDegrees |
the angle in degrees |