Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MathAndTrigo {
- public static void main(String[] args) {
- System.out.println((int)(Math.random() * 15));
- System.out.println(Math.abs(-50));
- System.out.println(Math.PI);
- System.out.println(Math.ceil(.77999));
- System.out.println(Math.floor(.77999));
- System.out.println("----------PROBLEM----------");
- //Problem
- double rts = 500; //c
- double rdbs = 450; //a
- double rtg = 10.0 / 1000.0;
- System.out.println(rtg);
- //c2 = a2 + b2
- //b2 = c2 - a2
- //b = sqrt(c2 - a2)
- double x = Math.sqrt(Math.pow(rts, 2) - Math.pow(rdbs, 2));
- System.out.println("b = " + x);
- //System.out.println(Math.acos(rdbs/radarToSatellite) * 180/Math.PI);
- //CAH = Cosine = Adj / hyp
- //arc cos (adjacent / hypotenus)
- System.out.println("z = " + Math.toDegrees(Math.acos(rdbs/rts)));
- System.out.println("y = " + (x + rtg));
- // Thanks!
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement