Package toxi.math.waves
Class SineWave
java.lang.Object
toxi.math.waves.AbstractWave
toxi.math.waves.SineWave
Standard Sine wave at fixed frequency and values normalized to the given
amplitude.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class toxi.math.waves.AbstractWave
cyclePhase, cyclePhase, hertzToRadians, pop, push, radiansToHertz, reset, setPhase, toString
-
Constructor Details
-
SineWave
public SineWave() -
SineWave
public SineWave(float phase, float freq) - Parameters:
phase
- starting phasefreq
- in radians (not Hertz)
-
SineWave
public SineWave(float phase, float freq, float amp, float offset) - Parameters:
phase
- starting phasefreq
- in radians (not Hertz)amp
- amplitude factoroffset
- centre oscillation value
-
-
Method Details
-
update
public float update()Description copied from class:AbstractWave
Updates the wave and returns new value. Implementing classes should manually ensure the phase remains in the 0...TWO_PI interval or by callingAbstractWave.cyclePhase()
.- Specified by:
update
in classAbstractWave
- Returns:
- current (newly calculated) wave value
-