Jump to content
  • Advertisement
Sign in to follow this  
NoFate

Something about Constructing Angles

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I am just popped in here to ask a question, you know in school when you're constructing angles and stuff, let us say I am gonna construct a 45 degrees angle, then I first have to construct a 90 degree angle and bisect that or something right? Well, I wrote an application just now that just draw angles, you type in which angle you want and it draws it. But, the thing is, is there any way to mathematically find out which angles you need to construct before you actually reach the goal of, lets say 45 Degree angle. Hope I made myself clear, if not then I can give it another shot.

Share this post


Link to post
Share on other sites
Advertisement
The methods you describe are geometrical ones which can be performed using a compass. The "mathematical" method you're asking about is called trigonometry.

Suppose that your starting point is some point (x0,y0) and that you have an angle theta. Now, you want to draw a line of length r from this point at theta degrees. The formula for this is:

x1 = r * cos(theta) + x0
y1 = r * sin(theta) + y0
DrawLine(x0,y0, x1,y1);

It's that easy! :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!