Advertisement
Shailrshah

Proving tan(A+B)=tanA+tanB/(1-tanA*tanB)

Oct 30th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. import java.util.Scanner;
  2. class Trigo{
  3.     public static void main(String[] args){
  4.                 Scanner sc = new Scanner(System.in);
  5.                 System.out.print("A: ");
  6.                 double A = sc.nextDouble();
  7.                 System.out.print("B: ");
  8.                 double B = sc.nextDouble();
  9.                 double tanA=Math.tan(A);
  10.                 double tanB=Math.tan(B);
  11.                 System.out.println("tan(A+B) = "+ Math.tan(A+B));
  12.                 System.out.println("tanA+tanB/(1-tanA*tanB) = "+((tanA+tanB)/(1-tanA*tanB)));
  13.                 System.out.println("The values are almost identical, proving the theorem.");
  14.                 System.out.println("\nAll values are in radians.")
  15.         }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement