Back to project page MathApp.
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.
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; } } }