Calculating Trigonometric Functions


// calculating cosine double cosine = Math.cos(45); // calculating sine double sine = Math.sin(45); // calculating tangent double tangent = Math.tan(45);



The Math class found in the java.lang package has methods for easily calculating all the trigonometric functions. In this phrase, we show how you can easily determine the cosine, sine, and tangent of a given angle. The Math class also has methods for calculating the arc cosine, arc sine, and arc tangent, as well as the hyperbolic sine, cosine, and tangent. Each of these methods accepts a single input parameter of double type and returns a result type of double.




JavaT Phrasebook. Essential Code and Commands
Java Phrasebook
ISBN: 0672329077
EAN: 2147483647
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net