Results 1 to 3 of 3
Thread: trig question
 10302010, 02:03 PM #1Member
 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!!!

Could you edit your post above to change the abbreviations to standard English? It's hard to read especially for our nonnative English speakers. Thanks.
 10302010, 02:28 PM #3
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,271
 Blog Entries
 7
 Rep Power
 24
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= 180ab (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
Similar Threads

Question mark colon operator question
By orchid in forum Advanced JavaReplies: 9Last Post: 12192010, 09:49 AM 
Question about what this do.
By Syfer in forum New To JavaReplies: 1Last Post: 07032010, 08:35 AM 
[SOLVED] Simple Trig Thing
By AndrewM16921 in forum New To JavaReplies: 4Last Post: 05162009, 06:45 AM 
Using the Math Trig Methods
By Java Tip in forum java.langReplies: 0Last Post: 04162008, 10:54 PM 
JNI question
By javaplus in forum New To JavaReplies: 0Last Post: 12242007, 11:18 AM
Bookmarks