Helper methods for interpolation
More...
|
static float | Linear (float a, float b, float u) |
| Linearly interpolate two numbers by a 0-1 range More...
|
|
static double | Linear (double a, double b, double u) |
| Linearly interpolate two numbers by a 0-1 range More...
|
|
static float | Cosine (float a, float b, float u) |
| Use cosine interpolation over a u time More...
|
|
static double | Cosine (double a, double b, double u) |
| Use cosine interpolation over a u time More...
|
|
static float | SmoothStep (float a, float b, float u) |
| Smooth interpolation, similar to cosine, but much faster More...
|
|
static double | SmoothStep (double a, double b, double u) |
| Smooth interpolation, similar to cosine, but much faster More...
|
|
Helper methods for interpolation
◆ Cosine() [1/2]
static float pluginbase.Helpers.Computative.Interpolate.Cosine |
( |
float |
a, |
|
|
float |
b, |
|
|
float |
u |
|
) |
| |
|
static |
Use cosine interpolation over a u time
- Parameters
-
a | The alpha component. |
b | The blue component. |
u | U. |
40 u = (1f - (float)Math.Cos(u * Math.PI)) * 0.5f;
41 return a * (1f - u) + b * u;
◆ Cosine() [2/2]
static double pluginbase.Helpers.Computative.Interpolate.Cosine |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
u |
|
) |
| |
|
static |
Use cosine interpolation over a u time
- Parameters
-
a | The alpha component. |
b | The blue component. |
u | U. |
52 u = (1f - (float)Math.Cos(u * Math.PI)) * 0.5f;
53 return a * (1f - u) + b * u;
◆ Linear() [1/2]
static float pluginbase.Helpers.Computative.Interpolate.Linear |
( |
float |
a, |
|
|
float |
b, |
|
|
float |
u |
|
) |
| |
|
static |
Linearly interpolate two numbers by a 0-1 range
- Parameters
-
a | The alpha component. |
b | The blue component. |
u | U. |
18 return a * (1f - u) + b * u;
◆ Linear() [2/2]
static double pluginbase.Helpers.Computative.Interpolate.Linear |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
u |
|
) |
| |
|
static |
Linearly interpolate two numbers by a 0-1 range
- Parameters
-
a | The alpha component. |
b | The blue component. |
u | U. |
29 return a * (1f - u) + b * u;
◆ SmoothStep() [1/2]
static float pluginbase.Helpers.Computative.Interpolate.SmoothStep |
( |
float |
a, |
|
|
float |
b, |
|
|
float |
u |
|
) |
| |
|
static |
Smooth interpolation, similar to cosine, but much faster
- Returns
- The step.
- Parameters
-
a | The alpha component. |
b | The blue component. |
u | U. |
65 u = u * u * (3f - 2f * u);
66 return a * (1f - u) + b * u;
◆ SmoothStep() [2/2]
static double pluginbase.Helpers.Computative.Interpolate.SmoothStep |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
u |
|
) |
| |
|
static |
Smooth interpolation, similar to cosine, but much faster
- Returns
- The step.
- Parameters
-
a | The alpha component. |
b | The blue component. |
u | U. |
78 u = u * u * (3f - 2f * u);
79 return a * (1f - u) + b * u;
The documentation for this class was generated from the following file: