Class SineWave


public class SineWave extends AbstractWave
Standard Sine wave at fixed frequency and values normalized to the given amplitude.
  • Constructor Details

    • SineWave

      public SineWave()
    • SineWave

      public SineWave(float phase, float freq)
      Parameters:
      phase - starting phase
      freq - in radians (not Hertz)
    • SineWave

      public SineWave(float phase, float freq, float amp, float offset)
      Parameters:
      phase - starting phase
      freq - in radians (not Hertz)
      amp - amplitude factor
      offset - 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 calling AbstractWave.cyclePhase().
      Specified by:
      update in class AbstractWave
      Returns:
      current (newly calculated) wave value