MathHelper
Declaration
public static class Strawberry.Math.MathHelper
Fields
FLOAT32_EPSILON static
float FLOAT32_EPSILON
E static
float E = 2.7182817
Log10E static
float Log10E = 0.4342945
Log2E static
float Log2E = 1.442695
Pi static
float Pi = 3.1415927
PiOver2 static
float PiOver2 = 1.5707964
PiOver4 static
float PiOver4 = 0.7853982
TwoPi static
float TwoPi = 6.2831855
Methods
Barycentric static
float Barycentric(float value1, float value2, float value3, float amount1, float amount2)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
|
value3 |
System.Single |
|
amount1 |
System.Single |
|
amount2 |
System.Single |
CatmullRom static
float CatmullRom(float value1, float value2, float value3, float value4, float amount)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
|
value3 |
System.Single |
|
value4 |
System.Single |
|
amount |
System.Single |
Clamp static
float Clamp(float value, float min, float max)
Parameters:
| Name | Type | Description |
|---|---|---|
value |
System.Single |
|
min |
System.Single |
|
max |
System.Single |
Distance static
float Distance(float value1, float value2)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
Hermite static
float Hermite(float value1, float tangent1, float value2, float tangent2, float amount)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
tangent1 |
System.Single |
|
value2 |
System.Single |
|
tangent2 |
System.Single |
|
amount |
System.Single |
RadToDeg static
double RadToDeg(double rad)
Parameters:
| Name | Type | Description |
|---|---|---|
rad |
System.Double |
DegToRad static
double DegToRad(double deg)
Parameters:
| Name | Type | Description |
|---|---|---|
deg |
System.Double |
ToDegrees static
float ToDegrees(float radians)
Parameters:
| Name | Type | Description |
|---|---|---|
radians |
System.Single |
ToRadians static
float ToRadians(float degrees)
Parameters:
| Name | Type | Description |
|---|---|---|
degrees |
System.Single |
Lerp static
float Lerp(float value1, float value2, float amount)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
|
amount |
System.Single |
LerpAngle static
float LerpAngle(float value1, float value2, float amount)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
|
amount |
System.Single |
WrapAngle static
float WrapAngle(float angle)
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
System.Single |
IsValid static
This function is used to ensure that a floating point number is not a NaN or infinity.
bool IsValid(float x)
Parameters:
| Name | Type | Description |
|---|---|---|
x |
System.Single |
SmoothStep static
float SmoothStep(float value1, float value2, float amount)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
|
amount |
System.Single |
Max static
float Max(float value1, float value2)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |
Min static
float Min(float value1, float value2)
Parameters:
| Name | Type | Description |
|---|---|---|
value1 |
System.Single |
|
value2 |
System.Single |