Change Coordinates

Started by
1 comment, last by fathom88 15 years, 6 months ago
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]
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).
Thanks. I'll code it up and run some numbers.

This topic is closed to new replies.

Advertisement