0
$\begingroup$

I have a given degree (0 - 360), and based on it, I'd like to be able to calculate the length of X and Y axis of a triangle built on that angle , if the third side of that triangle is equal to 1.

I studied it so long ago I cant remember it, what is the formula for that. Also, it's important to know if X and Y are negative or positive?

  • 0
    You do know you can't have an angle greater than or equal to $180^\circ$ within a triangle, yes?2011-05-06
  • 0
    Anyway, what you need are the cosine (horizontal) and the sine (vertical) of the angle...2011-05-06
  • 0
    @J.M. - The X and Y can be in 4 positions as there are 4 quarters, that creates the triangle.2011-05-06
  • 0
    Ah, then indeed you need to take the cosine and sine of the angle your line through the origin makes with the positive portion of the horizontal axis.2011-05-06
  • 0
    J.M. Can you write a formula please?2011-05-06

1 Answers 1

0

As J.M.'s been saying, the lengths of the horizonatal and vertical sides of the right handed triangle will be given by cos(a) and sin(a) respectively (where a is the angle between 0 and 360 degrees.)

This comes straight from the geometric definitions of cosine and sine: cos(a) is often defined as 'adjacent divided by hypotenuse.' However, as your hypotenuse is just 1, then the cos(a) = (the length of the adjacent side) = the length of the side on the x axis.

Similarly, sin(a) = the length of the opposite side = the length of the side on the Y axis.

Hope that makes some sense. You'll find that the negatives and positives are all accounted for as you swing around the circle. Look at http://en.wikipedia.org/wiki/Unit_circle if you want an overload of info :D

  • 0
    What if it would differ form 1, where does that affect?2011-05-06
  • 0
    It just scales the cosine and sine. Doubling the hypotenuse also doubles the legs.2011-05-06
  • 0
    AdjasentSide = lengthOfTheThirdSide * cos(a)?2011-05-06
  • 0
    OppositeSide = lengthOfTheThirdSide * sin(a)?2011-05-06
  • 0
    Did I get it right?2011-05-06
  • 0
    Well, as cos(a) = AdjacedSide/lengthOfTheThirdSide and sin(a) = OppositeSide/lengthoftheThirdSide I would have to say you're correct :D2011-05-06
  • 0
    BTW, you often call 'the length of the third side' the 'hypotenuse'2011-05-06
  • 0
    Thanks, I also just remembered it, when I read it in Wikipedia, I didn't study in English so It was a bit hard to get it.2011-05-06