Provides a collection of mathematical utility functions and constants.
float SquareWave(float ratio)
Generates a square wave value.
void SetPeriod(float period)
Sets the period of the waveform.
float SawtoothWave(float ratio)
Generates a sawtooth wave value.
float minimum
Minimum value of the waveform.
float maximum
Maximum value of the waveform.
Function
Enumerates the supported wave functions.
@ Gravity
Gravity-like function.
@ Sawtooth
Sawtooth waveform.
@ Triangle
Triangle waveform.
FunctionGenerator(Function function, float minimum, float maximum, float period)
Constructor to initialize the FunctionGenerator with parameters.
float GravityFunction(float ratio)
Generates a gravity-like function value.
float Update()
Updates and calculates the next value of the waveform.
Function function
Current waveform function.
float SineWave(float ratio)
Generates a sine wave value.
void SetFunction(Function function)
Sets the waveform function.
float TriangleWave(float ratio)
Generates a triangle wave value.
float period
Period of the waveform.