General Question Coordinate transformation question

Orville

Donator
Donator
Joined
Dec 13, 2013
Messages
10
Reaction score
0
Points
1
Location
South Korea
Given a velocity vector in the ecliptic inertial reference frame of a vessel orbiting the Moon (this vector is readily available in Orbiter), what transformation matrix, or series of transformation matrices, would provide the vessel's velocity vector in a reference frame fixed at the Moon's center (i.e. non-inertial and rotating with the Moon)?

Also, I have the same question regarding the similar transformation of position vector data.

Would appreciate any help. Thanks.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
464
Points
83
Website
orbit.medphys.ucl.ac.uk
For transforming the velocity:

[math] \vec{v} = \mathsf{R}_p^T \vec{v}_0 [/math]
For transforming the position:

[math] \vec{r} = \mathsf{R}_p^T (\vec{r}_0 - \vec{r}_p) [/math]
where R_p is the planet's rotation matrix (oapiGetRotationMatrix), r_p is the planet's position in the global ecliptic frame (oapiGetGlobalPos), r_0, v_0 are the state vectors in the ecliptic frame, and r, v the state vectors in the planet-relative frame. For the matrix-transpose x vector product use the tmul function.
 

Orville

Donator
Donator
Joined
Dec 13, 2013
Messages
10
Reaction score
0
Points
1
Location
South Korea
Thank you for the reply. I am not yet proficient in C++ and have thus far only been using Lua to write scripts in Orbiter. Guess I need to "get with the program" :) and learn some C++.

In the meantime can you tell me if these planet (and moon I assume) rotation matrices are generated from ephemeris data. If so, I think I can research this and generate the rotation matrices I need independently.

Thanks again.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
464
Points
83
Website
orbit.medphys.ucl.ac.uk
The planet's state vectors (r_p, and, if required v_p) are calculated from ephemeris data. But those values are also exposed to Lua (oapi.get_globalpos and oapi.get_globalvel).

The rotation matrix, it would appear, is not currently accessible via Lua. If you want to calculate it yourself, have a look at Doc/Technotes/precession.pdf. The rotation matrix is a combination of spin around the rotation axis, and precession of the axis.
 

BEEP

Addon Developer
Addon Developer
Joined
Apr 5, 2008
Messages
153
Reaction score
15
Points
18
Orville, Take a look (in OH) at my Lua Script addons codes. There are lots of coord transformations that you can use or adapt. Maybe you can take advantage from a geo equatorial coordinate (Lat,Lon) transform the way it is done there.
 

Orville

Donator
Donator
Joined
Dec 13, 2013
Messages
10
Reaction score
0
Points
1
Location
South Korea
BEEP:

Thanks for the lead. I'll be sure to check it out.

I'm also reviewing the technical note that Martins referenced (Planetary Axis Precession) with the goal of calculating the rotation matrix using the method outlined therein. I calculated the full transformation matrix using the two approaches shown in the tech note. But although I managed to get the magnitudes of the nine matrix values to match, the two matrices differ by a 180 degree rotation around the 'Y' axis. Still haven't figured out how that happened.

There is an interesting paper I discovered during my investigation titled "Report of the IAU/IAG Working Group on cartographic coordinates and rotational elements." It discusses reference frames and coordinate systems, and includes data for identifying a body-fixed coordinate system for the Moon (also for the planets and their moons). It's not an easy read but with some effort I hope to understand the document well enough to make use of the information it provides.

Orville
 
Top