Jump to content
  • Advertisement
Sign in to follow this  
fathom88

Change Coordinates

This topic is 3560 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

I'm given data using one coordinate method but need to plot using another one. Given: My data angle >>>>>>>>>>0 >>>>>>>>>>| >>>>>>>>>>| >>>>>>>>>>| 270 ----------------- 90 >>>>>>>>>>| >>>>>>>>>>| >>>>>>>>>>| >>>>>>>>>180 Plot: My desired angle >>>>>>90 >>>>>>| 180 --------- 0 >>>>>>| >>>>>>270 How would I convert a given angle to desired form. For instance, 90 would be 0, 180 would be 270 etc. I can't think of an easy formula. I could do it with a bunch of "if" statements but would like to avoid this. Thanks for any help. [Edited by - fathom88 on October 21, 2008 1:40:25 PM]

Share this post


Link to post
Share on other sites
Advertisement
Notice that to transform the top system into the bottom system, you must rotate it clockwise through 90 degrees and then reflect it in the x-axis. If the angle in the top system is a, then the angle in the bottom system is a' = -(a - 90) = 90 - a.

For example:

a = 90 degrees -> a' = 0 degrees
a = 180 degrees -> a' = (90 - 180) degrees = -90 degrees = 270 degrees


Note that the angle a' produced by this formula may not necessarily be in the range [0,360).

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!