• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Geometry questions (Angles and triangles)

This topic is 6050 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''ve got two geometry questions, I''ve searched all my geometry books and havn''t found anything that helps. My first problem is this: In this, I know A & B, and I can compute C (With the Pythagorean theorem ). I know that it is a right angle triangle, but I can''t figure out how to figure out the angles. (I need an equation I can convert into code) My second problem: I''ve got two points on a plane, and I need to find the angle of the A point in relation to the Y axis. I can find the slope of the line, but I don''t know how to convert this into degrees (Or radians)

##### Share on other sites
I may have found the answer to 1, would this work?
d=arctan(b/a)

##### Share on other sites
Now that I look at it, the second problem is the same as the first!

If the Arc Tangent works for the first, I should be able to apply it to the second.

Heh, solved my own problem. Sorry to waste space

##### Share on other sites
1. Angle AC is arctan( b / a ). Angle BC is arctan( a / b ).

2. The angle is arctan( (b.x - a.x) / (b.y - a.y) ).

Edit: seems I was a bit too slow

[edited by - Martee on June 28, 2002 9:53:27 PM]

##### Share on other sites
Ever heard of SOHCAHTOA?

~Dwarf

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 11
• 9
• 9
• 40
• ### Forum Statistics

• Total Topics
634130
• Total Posts
3015704
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!