toxi.math.waves
Class SineWave
java.lang.Object
toxi.math.waves.AbstractWave
toxi.math.waves.SineWave
public class SineWave
- extends AbstractWave
Standard Sine wave at fixed frequency and values normalized to the given
amplitude.
Constructor Summary |
SineWave()
|
SineWave(float phase,
float freq)
|
SineWave(float phase,
float freq,
float amp,
float offset)
|
Method Summary |
float |
update()
Updates the wave and returns new value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
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
calling
AbstractWave.cyclePhase()
.
- Specified by:
update
in class AbstractWave
- Returns:
- current (newly calculated) wave value