Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Bonsai Boy of New York Bonsai Trees and Accessories

BlueHost Web Hosting

Liquid Web Managed Dedicated Server: RAID 1 SSD with 16GB of RAM minimum! 24/7 On-Site Heroic Support! Industry-Leading SLA!

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Liquid Web Cloud VPS Hosting

10,484 questions

14,262 answers

573 users

How to use trigonometric math methods in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
       System.out.println("1) " + Math.toDegrees(Math.PI /2));
       System.out.println("2) " + Math.toDegrees(Math.PI /4));
       
       System.out.println("3) " + Math.toRadians(30));
       System.out.println("4) " + Math.toRadians(36));
       
       System.out.println("5) " + Math.sin(0));
       System.out.println("6) " + Math.sin(Math.toRadians(180)));
       System.out.println("7) " + Math.sin(Math.PI / 2));
       System.out.println("8) " + Math.sin(Math.PI / 4));

       System.out.println("9) " + Math.cos(0));
       System.out.println("10) " + Math.cos(Math.PI / 2));
       System.out.println("11) " + Math.cos(Math.PI / 4));
       
       System.out.println("12) " + Math.asin(0.5));
       System.out.println("13) " + Math.asin(1));
       
       System.out.println("14) " + Math.acos(0.5));
       System.out.println("15) " + Math.acos(1));
       
       System.out.println("16) " + Math.atan(0.5));
       System.out.println("17) " + Math.atan(1.0));
    }
}



/*
run:

1) 90.0
2) 45.0
3) 0.5235987755982988
4) 0.6283185307179586
5) 0.0
6) 1.2246467991473532E-16
7) 1.0
8) 0.7071067811865475
9) 1.0
10) 6.123233995736766E-17
11) 0.7071067811865476
12) 0.5235987755982989
13) 1.5707963267948966
14) 1.0471975511965979
15) 0.0
16) 0.4636476090008061
17) 0.7853981633974483

*/

 




answered Jun 10 by avibootz
...