Amiga.org

Coffee House => Coffee House Boards => CH / Science and Technology => Topic started by: motorollin on August 15, 2007, 07:03:29 PM

Title: A trigonometry question
Post by: motorollin on August 15, 2007, 07:03:29 PM
I have done some reading on trigonometry (at least I think that's what I need) but I still can't work this out!

(http://i298.photobucket.com/albums/mm244/motorollin/aorg/triangle.jpg)

Assuming you know the lengths of sides x and y, how would you calcualate angle a?

TIA

--
moto
Title: Re: A trigonometry question
Post by: Cass on August 15, 2007, 07:40:31 PM
tanA=y/x

You get a value and then check a Trigonometric Table (http://math2.org/math/trig/tables.htm) ;-)
Title: Re: A trigonometry question
Post by: motorollin on August 15, 2007, 08:13:10 PM
Thanks! Do you know which C trigonometry function will convert the result of y/x to an angle?

--
moto
Title: Re: A trigonometry question
Post by: motorollin on August 15, 2007, 08:20:42 PM
Never mind, I have just found out that the language I'm using has a direction() command which calculates the angle in degrees between two points, which is exactly what I'm trying to do. Thanks anyway Cass.

--
moto
Title: Re: A trigonometry question
Post by: Doobrey on August 15, 2007, 09:19:59 PM
There's 2 things I always remember from maths lessons at school
1. Don't offend the teacher by mentioning her hairy legs.

2. The 'SOH CAH TOA' rule

  Sine(a)=Opposite/Hypotenuse
  Cosine(a)=Adjacent/Hypotenuse
  Tangent(a)= Opposite/Adjacent

Looking at your diagram,since you know x=adjacent, y=opposite, so you can calculate the tangent. From that, you can calculate the angle by using the inverse tangent function (also called arc tangent)

  angle=atan(y/x);

Dunno what language you're using, but in C  the atan() result is in radians, so you have to multiply the result by (180/PI) to convert to degrees.
Title: Re: A trigonometry question
Post by: Cymric on August 16, 2007, 10:46:21 AM
I can never remember 'opposite' and 'adjacent', so instead I remember by means of a circle with unit radius. Then the sine of an angle is simply it's y-coordinate where it intersects the circle; the cosine the x-coordinate; and the tangent y divided by x, because it should be infinite at x = 0, and that can only happen if you divide by 0. It has the advantage of working in all four quadrants too; the SOH-something rule only works in the first of the four...
Title: Re: A trigonometry question
Post by: Karlos on August 16, 2007, 04:38:15 PM
Sid On His Camel Always Had The Ointment Afterwards
Title: Re: A trigonometry question
Post by: A4000_Mad on August 16, 2007, 07:21:04 PM
Some Officers Have Curley Auburn Hair To Offer Attraction

For some reason that's the one my grandad taught me :lol:
Title: Re: A trigonometry question
Post by: JaXanim on August 16, 2007, 07:26:38 PM
Write  O A O A H H
Draw a line underneath
Under this, write the letters again backwards H H A O A O
Each ratio reading left to right gives you:
sine, cosine, tangent, cotangent, secant and cosecant

Learned that when I was 12 and will never forget.

Jax
Title: Re: A trigonometry question
Post by: Boot_WB on August 16, 2007, 11:10:00 PM
Silly Old Harry Caught A Herring Trawling Off Afghanistan

Although nowadays I just remember Sohcahtoa.

@Cymric - I like that, and it fits with my Maths education with the four quadrants. I guess your starting point is x=1, y=0, and your moving anticlockwise (the positive direction).

Incidentally Sohcahtoa only deals with right angled triangles, ergo you would always be within the first quadrant. Anything else and you would have to invoke the sine or cosine rules.
Title: Re: A trigonometry question
Post by: Dandy on August 17, 2007, 09:01:23 AM
Quote

Doobrey wrote:

...
2. The 'SOH CAH TOA' rule

  Sine(a)=Opposite/Hypotenuse
  Cosine(a)=Adjacent/Hypotenuse
  Tangent(a)= Opposite/Adjacent
...



Hehe - in German that sounds more funny:
'GAGA'-rule...

Sinus(a) = Gegenkathete/Hypothenuse
Cosinus(a) = Ankathete /Hypothenuse
Tangens(a) = Gegenkathete/Ankathete
Cotangens(a) = Ankathete/Gegenkathete
 :-D
Title: Re: A trigonometry question
Post by: Cymric on August 17, 2007, 12:12:47 PM
Quote
@Cymric - I like that, and it fits with my Maths education with the four quadrants. I guess your starting point is x=1, y=0, and your moving anticlockwise (the positive direction).

Yes. I should have added the following: 'Position the angle at the origin, with one of its 'legs' positioned on the X-axis. Extend the other 'leg' until it intersects the circle. Then the sine of the angle is the y-coordinate of the intersection point, ...'

And yes, you do move anticlockwise that way. It's rather like the opening of a book, or (even better) a spiral binder.