Click here to watch in Youtube :
https://www.youtube.com/watch?v=hBvEhNbd6zk&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Math class (Trigonometric methods) |
public class MathDemo { public static void main(String[] args) { double degrees = 25.0; double radians = Math.toRadians(degrees); System.out.format("The value of pi " + "is %.4f%n", Math.PI); System.out.format("The sine of %.1f " + "degrees is %.4f%n", degrees, Math.sin(radians)); System.out.format( "The cosine of %.1f " + "degrees is %.4f%n", degrees, Math.cos(radians)); System.out.format("The tangent of %.1f " + "degrees is %.4f%n", degrees, Math.tan(radians)); System.out.format("The arcsine of %.4f " + "is %.4f degrees %n", Math.sin(radians), Math.toDegrees(Math.asin(Math.sin(radians)))); System.out.format("The arccosine of %.4f " + "is %.4f degrees %n", Math.cos(radians), Math.toDegrees(Math.acos(Math.cos(radians)))); System.out.format("The arctangent of %.4f " + "is %.4f degrees %n", Math.tan(radians), Math.toDegrees(Math.atan(Math.tan(radians)))); } }
The value of pi is 3.1416 The sine of 25.0 degrees is 0.4226 The cosine of 25.0 degrees is 0.9063 The tangent of 25.0 degrees is 0.4663 The arcsine of 0.4226 is 25.0000 degrees The arccosine of 0.9063 is 25.0000 degrees The arctangent of 0.4663 is 25.0000 degrees
https://sites.google.com/site/javaee4321/java/MathDemo_Trigonometric_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/MathDemo_Trigonometric_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/d0559102086f9677d57877fbba43556aca45fc19/BasicJava/MathDemo_Trigonometric_App/?at=master
See also:
No comments:
Post a Comment