1. Member Join Date
Oct 2010
Posts
5
Rep Power
0

## trig question

hey im new to java and have to write a program which outputs the following:

Enter the distance between the trig points: 1245
Enter the angle from trig point 1: 34
Enter the angle from trig point 2: 78

The distance from point 1 is 1313.43 metres.
The distance from point 2 is 750.87 metres.

and i dnt really knw how to use math class: i hv done the following

import java.util.Scanner;

public class Ques1
{

public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int distance, angle_1, angle_2;
double lenght_1, lenght_2;
// distance is the distance between the two Trig points (f)//
// angle_1 is the Trig point 1 (T1)//
// angle_2 is the Trig point 1 (T2)//

System.out.print("Enter the distance between the trig points: ");
distance = scan.nextInt();

System.out.print("Enter the angle from trig point 1: ");
angle_1 = scan.nextInt();

System.out.print("Enter the angle from trig point 2: ");
angle_2 = scan.nextInt();

}
}

could anybody plz tell me how to use th Math.PI and sin for this question.

i knw my question sounds really silly, but plz try n help!!!  Reply With Quote

2. ## Could you edit your post above to change the abbreviations to standard English? It's hard to read especially for our non-native English speakers. Thanks.  Reply With Quote

3. ## For any triangle with sides A, B and C and opposite angles a, b and c the following equation holds: sin(a)/A == sin(b)/B == sin(c)/C. You know the angles a and b so c= 180-a-b (in degrees). You also know the length of two of the sides so that is enough to calculate the length of the other side.

kind regards,

Jos  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•