Advertisement
Guest User

Untitled

a guest
May 6th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. /*
  5. * To change this license header, choose License Headers in Project Properties.
  6. * To change this template file, choose Tools | Templates
  7. * and open the template in the editor.
  8. */
  9. /**
  10. *
  11. * @author Esc
  12. */
  13. public class lentorata {
  14.  
  15. /**
  16. * @param args the command line arguments
  17. */
  18. public static void main(String[] args) {
  19. Scanner sc = new Scanner(System.in);
  20.  
  21. System.out.println("Lähtönopeus");
  22. double v = Double.parseDouble(sc.nextLine());
  23.  
  24. System.out.println("Lähtökulma");
  25. double a = Double.parseDouble(sc.nextLine());
  26.  
  27. //double x = t * v * Math.cos(a);
  28. double g = 9.81;
  29.  
  30. //double y = -((g * t * t)/2) + t * v * Math.sin(a);
  31. double t = ((g / 2) / Math.sin(Math.toRadians(a))) / v;
  32.  
  33.  
  34. double ttrue = t / (t * t);
  35. System.out.println(ttrue);
  36.  
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement