Coordinates transformation

Poscik

Addon Developer
Addon Developer
Joined
Mar 28, 2008
Messages
512
Reaction score
3
Points
18
Location
Sulejówek
Hi. I'm trying to develop simple "3D Telemetry Visualisation Tool" especially for shuttle ultra. I have to rotate Earth correct way to show shuttle movement. So that I think I have to combine one resultant axis from XYZ axes, and rotate over it. Schematic view, R is the axis I am looking for, blue arrow is needed rotation direction:
schemat.jpg

Only thing I figured out is that blue axis has to be perpendicular to Center-Equator vector. In presented case it is very simple to do. To calculate blue axis I need to rotate my frame by 90-a over y axis and then x axis will automatically be R axis. But what if orbital plane won't be perpendicular to y axis? Any idea how to combine resultant axis then?


Ah, and how does that app look like:
screenshot03262011_172544191.jpg
 
Last edited:

Fizyk

Member
Joined
Jun 20, 2008
Messages
285
Reaction score
1
Points
18
Location
Warsaw
Website
ebvalaim.net
Just take LAN into account. Rotate around z axis by -LAN (or something like this, depends on how you define LAN in your program), so that the y axis is in the orbital plane, then around y axis like before.

EDIT: On the second thought, you should do this the other way round and it can be simplified a bit. Here is how I would do it:

1. Take the vector (0,0,1) (parallel to the Z axis).
2. Rotate it by a degrees around Y axis, so it becomes (sin(a), 0, cos(a)).
3. Rotate the result LAN degrees around the Z axis, so you get (sin(a)*cos(LAN), sin(a)*sin(LAN), cos(a)).
(This way LAN is the angle between a vector pointing to the intersection of the orbital plane with the equator and the Y axis, growing in the direction of the X axis. If you want it differently, you will need to change the rotations a bit.)

Your vector perpendicular to the orbital plane (the r vector) would be (sin(a)*cos(LAN), sin(a)*sin(LAN), cos(a)) (or, to be more like on the drawing, a negative of that).
 
Last edited:

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
It looks to me like the vector r is coincident with the relative orbital angular momentum. You can calculate that vector from the state vectors - as the cross product of the radius vector (from the centre of the Earth to the Orbiter) and the velocity vector. No transformation is necessary if the state vectors are in Earth equatorial coordinates, but if you are getting them from VESSELSTATUS they will be in ecliptic coordinates (but Earth relative) and you will need to transform them into Earth equatorial coordinates by multiplying them by the inverse of Earth's rotation matrix (see oapiGetPlanetObliquityMatrix).
 
Top