Solving triangle angles

Sidle up to the bar (Lightly Moderated)

Moderator: Dictators in Training

Solving triangle angles

Postby KaiineTN » Tue Jan 16, 2007 7:49 pm

I completely forgot how to do this crap. Do any of you remember? I'm working on a program that needs to solve angles of a triangle. I'm messing around with the Math.Sin/Cos/Tan functions and they're always giving me numbers that are way off what they should be. I must be doing something wrong.

Basically, it's for a right triangle, so all I need is to solve for angleA.

In other words, say you have a right triangle with sides 5, 5, and 7 (7.07 to be more specific). Obviously, that's going to be 45 degrees, 45 degrees, and 90 degrees, but how would you find that out mathematically from using the lengths of the sides?

the part of the program in a nutshell:

have the variables: sideA, sideB, and sideC

angleA = <insert help here>
angleB = 180 - (90 + angleA)
angleC = 90
User avatar
KaiineTN
NT Patron
NT Patron
 
Posts: 3629
Joined: Tue Mar 09, 2004 2:21 pm

Postby Phlegm » Tue Jan 16, 2007 8:04 pm

sin A = a/c
cos A = b/c
tan A = a/b

where:
A = angleA
a = sideA
b = sideB
c = sideC
Phlegm
Nappy Headed Ho
Nappy Headed Ho
 
Posts: 6258
Joined: Tue Aug 03, 2004 5:50 pm

Postby Gaazy » Tue Jan 16, 2007 8:21 pm

a squared + b squared = c squared? i dunno. Whatever Phlegm said~
User avatar
Gaazy
NT Deity
NT Deity
 
Posts: 5837
Joined: Fri Mar 12, 2004 8:32 am
Location: West by god Virginia

Postby KaiineTN » Tue Jan 16, 2007 10:38 pm

Phlegm wrote:sin A = a/c
cos A = b/c
tan A = a/b

where:
A = angleA
a = sideA
b = sideB
c = sideC


How does that help me know what angle A is? So I have Sin A = 5/7. I need to know the process/explanation so I know how to put it into programming.
User avatar
KaiineTN
NT Patron
NT Patron
 
Posts: 3629
Joined: Tue Mar 09, 2004 2:21 pm

Postby Snero » Wed Jan 17, 2007 6:49 am

most calculators have a function sin^-1, you would do 5/7 and use that function after. (the inverse function of sin)
Snero
NT Disciple
NT Disciple
 
Posts: 761
Joined: Mon Mar 08, 2004 1:53 am

Postby AndyM » Wed Jan 17, 2007 12:05 pm

Law of Cosines.

Given a triangle of three sides of known length ( a, b, c ), and three unknown opposite angles (alpha, beta, gamma) then:

gamma = arccos [( a^2 + b^2 - c^2)/(2*a*b)]

Andy
AndyM
NT Bixie
NT Bixie
 
Posts: 4
Joined: Thu Dec 28, 2006 7:54 pm

Postby Snero » Wed Jan 17, 2007 12:17 pm

thats overcomplicating things for a right triangle though, you can just use your basic trig functions

the way i was taught to remember was SOH CAH TOA, Sin=Opposite/Hypotenuse, Cos=Adjacent/Hypotenuse, and Tan=Opposite/Adjacent

those work just fine when you have a right triangle. If you don't, then you have to use the law of cosines or law of sines to find it
Snero
NT Disciple
NT Disciple
 
Posts: 761
Joined: Mon Mar 08, 2004 1:53 am

Postby KaiineTN » Wed Jan 17, 2007 12:22 pm

I think I figured out why it's not working properly. I think I need to convert to radians for programming, then have the answer converted back to degrees. I'll give it a shot later.
Image
User avatar
KaiineTN
NT Patron
NT Patron
 
Posts: 3629
Joined: Tue Mar 09, 2004 2:21 pm


Return to Cap's Alehouse

Who is online

Users browsing this forum: No registered users and 42 guests

cron