How is the orientation of a planet defined?

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

How is the orientation of a planet defined?

Post #1by Malenfant » 04.11.2005, 20:40

Code: Select all

   RotationPeriod        10.65622 # System III (magnetic field)
   Obliquity             28.049   # 28.052   # old value: 26.73
   EquatorAscendingNode 169.530   # 168.8112 # 169.53
        RotationOffset       358.922   # correct System III prime meridian


The code snippet above is from the solarsys.ssc file, for Saturn.

I'd like to know is how EquatorAscendingNode and RotationOffset are defined, and what the source for these values are.

I can find an "alpha0" and "delta0" value for the "RA and declination of date of a planet's north pole" in the USNO Explanatory Supplement of the Astronomical Almanac but I don't think these are the same thing as what's in the ssc.

The reason I'm asking is that I'm trying to figure out how to calculate the planetocentric latitude of the sub-observer point (from this I can know the tilt of the rings relative to the observer), and for that I need to know how the orientation of the planet in space is defined.

Can anyone help?

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #2by granthutchison » 04.11.2005, 22:59

Selden sends me.
Obliquity is the tilt of the axis relative to the ecliptic plane.
EquatorAscendingNode is the position of the ascending node of the planet's equator, on the ecliptic plane, measured from the vernal equinox (that is, its ecliptic longitude).
RotationOffset is the angular separation of the planet's prime meridian, at epoch, from the EquatorAscendingNode, measured along the planet's equator.

These three parameters define the rotation state of the planet for Celestia. A bit of spherical trig is required to derive them from the usual parameters supplied in reference books: the declination (delta0) and right ascension (alpha0) of the pole, and the prime meridian offset (W) from the planet's equatorial ascending node on the Earth's equatorial plane.

Grant

cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 8 months
Location: Victoria, BC Canada

Re: How is the orientation of a planet defined?

Post #3by cpotting » 04.11.2005, 23:07

Malenfant wrote:The reason I'm asking is that I'm trying to figure out how to calculate the planetocentric latitude of the sub-observer point (from this I can know the tilt of the rings relative to the observer), and for that I need to know how the orientation of the planet in space is defined.

Can anyone help?


Since you are referring to the sub-observer point, I assume you are working on a celx script. If not, just ignore the following as the rantings of a misguided fool :)

You should not need to bother with the information in the ssc file. The latitude and longitude can be calculated from information available within celx. The following code (taken from the Celx Visual Guide) should demonstrate:

Code: Select all

u_pos = celestia:getobserver():getposition()
e_frame = celestia:newframe("planetographic", celestia:find("Earth"))
e_pos = e_frame:to(u_pos)
lng = math.atan2(e_pos.z, -e_pos.x);
lat = math.pi / 2 - math.atan2(math.sqrt(e_pos.x * e_pos.x + e_pos.z * e_pos.z), e_pos.y)
celestia:flash("We are over lat " .. math.deg(lat) .. ", long " .. " .. math.deg(lng), 10)
wait(5)


What is it doing?

Code: Select all

u_pos = celestia:getobserver():getposition()
The first line simply gets the oberserver's position expressed in universal coordinates (an X-Y-Z coodinate system centered on a point about 200 au from the Sun).

Code: Select all

e_frame = celestia:newframe("planetographic", celestia:find("Earth"))
Now we generate a new object that represents a coordinate system centred on Earth, aligned with Earth's poles and equator and rotating as Earth rotates (sound familiar - that's exactly what the latitude-longitude system is - the only difference is that the "planetographic" system is an X-Y-Z coordinate system, not an Angle-Angle system).

Code: Select all

e_pos = e_frame:to(u_pos)
Now we convert the XYZ position in the universal coordinates to an XYZ position in the planetographic coordinates (ie. convert "how far X-wise, Y-wise and Z-wise are we from that point 200 au from the sun" to "how far are we X-wise, Y-wise and Z-wise from the centre of the Earth"). We now know where the observer is relative to the Earth.

Code: Select all

lng = math.atan2(e_pos.z, -e_pos.x);
lat = math.pi / 2 - math.atan2(math.sqrt(e_pos.x * e_pos.x + e_pos.z * e_pos.z), e_pos.y)
A little trig and we have the observer's latitude and longitude.

Code: Select all

celestia:flash("We are over lat " .. math.deg(lat) .. ", long " .. " .. math.deg(lng), 10)
wait(5)
Voila!
Clive Pottinger
Victoria, BC Canada

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #4by Malenfant » 04.11.2005, 23:45

thanks guys. Actually Clive's on the right track I think (yes, it was for a script!) :) - though what I want is the latitude that the observer is above on another planet, not Earth. But it looks like I should be able to figure out how to do this from your script here (this is ideal fodder for the Q&A pages of the wikibook, BTW)

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #5by granthutchison » 05.11.2005, 00:14

If you want the tilt of Saturn's rings from the Earth:
1) Take the RA and dec of Saturn in Earth's sky.
2) The RA and dec of Earth in Saturn's sky are on the reciprocal bearing: -1*dec, RA+180.
3) Now you have Earth's position and Saturn's pole position (alpha0, delta0) in the same coordinate frame.
4) Any textbook on mathematical astronomy will give you a formula to calculate the angular distance between two points with known spherical coordinates.
5) Subtract the angular distance between Earth and Saturn's pole from 90 degrees: this gives you the planetocentric latitude of Earth in Saturn's sky, which is equal to the tilt of Saturn's rings seen from Earth.

If you're generalizing this, working from Celestia's coordinates, then you're probably best to stay in ecliptic coords.
The ecliptic coordinates of a planet's pole are:
lambda0 = EquatorAscendingNode - 90
beta0 = 90 - Obliquity

Grant

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #6by Malenfant » 05.11.2005, 04:34

Actually Grant, Clive's script seems to do the trick (couple of syntax errors there though), but thanks anyway.

The altered script below gives the lat/lon of th sub-observer point on Saturn (note, I want want the modulus of the latitude here).

Code: Select all

u_pos = celestia:getobserver():getposition()
e_frame = celestia:newframe("planetographic", celestia:find("Saturn"))
e_pos = e_frame:to(u_pos)
lng = math.atan2(e_pos.z, -e_pos.x);
lat = math.pi / 2 - math.atan2(math.sqrt(e_pos.x * e_pos.x + e_pos.z * e_pos.z), e_pos.y)
if (lat < 0) then lat = lat *-1   -- finds the 'mod' of the latitude.
end
celestia:flash("We are over lat "..math.deg(lat)..", lon "..math.deg(lng), 10)
wait(5)


I can't seem to get math.mod(lat) to work, oddly enough, hence the multiplying by -1 if it's less than 0.

cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 8 months
Location: Victoria, BC Canada

Post #7by cpotting » 05.11.2005, 14:42

Malenfant wrote:Clive's script seems to do the trick (couple of syntax errors there though)
SYNTAX ERRORS! :x Syntax errors! I make never syntax errors! :wink:

Malenfant wrote:I can't seem to get math.mod(lat) to work, oddly enough, hence the multiplying by -1 if it's less than 0.


I don't think you really wanted mod(). Mod() gives the modulus of two numbers (i.e. the remainder if you divide one number by the other). I think what you really wanted was abs() which gives the absolute value of number (i.e. the positive value).
Clive Pottinger
Victoria, BC Canada

Topic author
Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #8by Malenfant » 05.11.2005, 16:29

cpotting wrote:SYNTAX ERRORS! :x Syntax errors! I make never syntax errors! :wink:

I guess the forum software must have corrupted your code and messed up the quotemarks in the flash statement then ;).

I don't think you really wanted mod(). Mod() gives the modulus of two numbers (i.e. the remainder if you divide one number by the other). I think what you really wanted was abs() which gives the absolute value of number (i.e. the positive value).


Er. Yes, I did want abs(). Um, all this time I've thought that "|x|" was said as "modulus x"... is that wrong?! 8O

cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 8 months
Location: Victoria, BC Canada

Post #9by cpotting » 05.11.2005, 19:28

Malenfant wrote:
cpotting wrote:SYNTAX ERRORS! :x Syntax errors! I make never syntax errors! :wink:

I guess the forum software must have corrupted your code and messed up the quotemarks in the flash statement then ;).
Yeah! darn unpredictable bbs software... must be a Microsoft product.

Malenfant wrote:Er. Yes, I did want abs(). Um, all this time I've thought that "|x|" was said as "modulus x"... is that wrong?! 8O

|x| can often mean many different things (depending on what function the author can't find a suitable symbol for. :) ). But it is often used to mean, and read as, "the absolute value of x".

I don't think there is a standard symbol for modulus, but I have seen a large filled in dot used, as in: 25 o 3 = 4 (but the o should be solid).
Clive Pottinger
Victoria, BC Canada


Return to “Development”