Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|cite|improve this question
You do know you can't have an angle greater than or equal to $180^\circ$ within a triangle, yes? –  J. M. is back. May 6 '11 at 13:19
Anyway, what you need are the cosine (horizontal) and the sine (vertical) of the angle... –  J. M. is back. May 6 '11 at 13:20
@J.M. - The X and Y can be in 4 positions as there are 4 quarters, that creates the triangle. –  Dean May 6 '11 at 13:38
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. –  J. M. is back. May 6 '11 at 13:40
J.M. Can you write a formula please? –  Dean May 6 '11 at 13:42

1 Answer 1

up vote 0 down vote accepted

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 if you want an overload of info :D

share|cite|improve this answer
What if it would differ form 1, where does that affect? –  Dean May 6 '11 at 14:10
It just scales the cosine and sine. Doubling the hypotenuse also doubles the legs. –  J. M. is back. May 6 '11 at 14:12
AdjasentSide = lengthOfTheThirdSide * cos(a)? –  Dean May 6 '11 at 14:13
OppositeSide = lengthOfTheThirdSide * sin(a)? –  Dean May 6 '11 at 14:15
Did I get it right? –  Dean May 6 '11 at 14:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.