Empeld
Empeld plugin documentation.
pluginbase.Helpers.Computative.Interpolate Class Reference

Helper methods for interpolation More...

Static Public Member Functions

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...
 

Detailed Description

Helper methods for interpolation

Member Function Documentation

◆ 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
aThe alpha component.
bThe blue component.
uU.
39  {
40  u = (1f - (float)Math.Cos(u * Math.PI)) * 0.5f;
41  return a * (1f - u) + b * u;
42  }

◆ 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
aThe alpha component.
bThe blue component.
uU.
51  {
52  u = (1f - (float)Math.Cos(u * Math.PI)) * 0.5f;
53  return a * (1f - u) + b * u;
54  }

◆ 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
aThe alpha component.
bThe blue component.
uU.
17  {
18  return a * (1f - u) + b * u;
19  }

◆ 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
aThe alpha component.
bThe blue component.
uU.
28  {
29  return a * (1f - u) + b * u;
30  }

◆ 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
aThe alpha component.
bThe blue component.
uU.
64  {
65  u = u * u * (3f - 2f * u);
66  return a * (1f - u) + b * u;
67  }

◆ 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
aThe alpha component.
bThe blue component.
uU.
77  {
78  u = u * u * (3f - 2f * u);
79  return a * (1f - u) + b * u;
80  }

The documentation for this class was generated from the following file: