Android Open Source - MathApp Wave






From Project

Back to project page MathApp.

License

The source code is released under:

MIT License

If you think the Android project MathApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ie.lc.mathApp;
/*from  www . ja  va  2  s. co m*/




public enum Wave
{
  sine,
  triangle,
  square;
  
  
  
  
  
  public static Wave random() {
    Wave[] vals = Wave.values();  
    return vals[ Util.randomIntRange(0, vals.length) ];
  }
  
  
  
  
  
  public String toString() {
    return Util.capitalise( name() );
  }
  
  
  
  
  
  public double evaluate( double input, double wavelength, double low, double high ) {
    switch (this) {
      case sine:     return Geo.sineSync( input, wavelength, low, high );
      case triangle: return Geo.triSync ( input, wavelength, low, high );
      case square:   return Geo.sqrSync ( input, wavelength, low, high );
      default:       return Double.NaN;
    }
  }
}




Java Source Code List

ie.lc.mathApp.ActivityArithmetic.java
ie.lc.mathApp.ActivityCommonMenu.java
ie.lc.mathApp.ActivityGameBase.java
ie.lc.mathApp.ActivityScore.java
ie.lc.mathApp.ActivitySqrt.java
ie.lc.mathApp.ActivityWave.java
ie.lc.mathApp.CallbackThread.java
ie.lc.mathApp.Callback.java
ie.lc.mathApp.Geo.java
ie.lc.mathApp.Operator.java
ie.lc.mathApp.ScoreData.java
ie.lc.mathApp.Score.java
ie.lc.mathApp.SeekBarAdapter.java
ie.lc.mathApp.Storage.java
ie.lc.mathApp.TextWatcherAdapter.java
ie.lc.mathApp.Util.java
ie.lc.mathApp.Wave.java