Advertisement
icorrelate

MathAndTrigo.java

Dec 12th, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1.  
  2. public class MathAndTrigo {
  3. public static void main(String[] args) {
  4.  
  5. System.out.println((int)(Math.random() * 15));
  6.  
  7. System.out.println(Math.abs(-50));
  8.  
  9. System.out.println(Math.PI);
  10. System.out.println(Math.ceil(.77999));
  11.  
  12. System.out.println(Math.floor(.77999));
  13.  
  14.  
  15. System.out.println("----------PROBLEM----------");
  16. //Problem
  17. double rts = 500; //c
  18. double rdbs = 450; //a
  19.  
  20. double rtg = 10.0 / 1000.0;
  21. System.out.println(rtg);
  22.  
  23. //c2 = a2 + b2
  24. //b2 = c2 - a2
  25. //b = sqrt(c2 - a2)
  26.  
  27. double x = Math.sqrt(Math.pow(rts, 2) - Math.pow(rdbs, 2));
  28. System.out.println("b = " + x);
  29.  
  30. //System.out.println(Math.acos(rdbs/radarToSatellite) * 180/Math.PI);
  31.  
  32. //CAH = Cosine = Adj / hyp
  33. //arc cos (adjacent / hypotenus)
  34.  
  35. System.out.println("z = " + Math.toDegrees(Math.acos(rdbs/rts)));
  36.  
  37. System.out.println("y = " + (x + rtg));
  38. // Thanks!
  39.  
  40.  
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement