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

 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.
39  {
40  u = (1f - (float)Math.Cos(u * Math.PI)) * 0.5f;
41  return a * (1f - u) + b * u;
42  }
 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.
51  {
52  u = (1f - (float)Math.Cos(u * Math.PI)) * 0.5f;
53  return a * (1f - u) + b * u;
54  }
 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.
17  {
18  return a * (1f - u) + b * u;
19  }
 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.
28  {
29  return a * (1f - u) + b * u;
30  }
 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.
64  {
65  u = u * u * (3f - 2f * u);
66  return a * (1f - u) + b * u;
67  }
 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.
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: