r/math•
JMile69

Trig Confusion, Location On A Plane

Ok, 2 Dimensional Orbital Motion. Imagine Mars going around the sun on a 2D plane.

Let's say that I know that Mars' initial angle from the Sun (looking down on the plane) is 247 degrees and it's distance from the Sun is 2273919.62. This would put it down and to the left of the Sun.

Knowning the angle and that radius (consequently the hypotenuse), I can calulate it's x and y positions. I'm using excel so I have to convert all of my angles into radians... The formula's are...

X = r cos(angle)

Y = r sin(angle)

This gives me...

X = -88849106.06

Y = -2095271.52

That's great, exactly correct (because I also happen to know what the initial X and initial Y position is).

The problem I keep running into is trying to go backwards, from the position to an angle. Using the initial position....

Angle = (180(opposite)) / (pi * hypotenuse)

yay, I know all these things... So I should be able to spit the exactly same angle back out, 247...

Angle = (180 * -2095271.52) / (pi * 2273919.62) = -52.74 ....... fail

Ok, well negative angles are gay, so mod(-52.74, 360) = 307.25 GRRRRRRRRRRRRRRRR! Not even close!

The closest I can get is by using the law of cosines.... Getting the opposite angle, and subracting that and 90 from 180, which gives me -67 degrees. Now this is the correct angle, but with respect to the negative x origin and not the full 360 degrees of the circle (67 + 180 = 247). I could just add abs(-67) + 180, and that's fine and dandy until Mars cross's the 360 degree mark and we are back at 0, then it get's all fucked up for obvious reasons.

WTF!@#$$@!

I guess the really question is, how exactly, on a 2D plane, can you convert from the angle from the origin (in 360 degrees) and back to a position? Am I using the wrong formulas, or is there something else I'm missing?

Posted Nov 3, 2010, 4:13 PM UTC

07
Loading comments…