orientation observer in Earth equatorial frame

All about writing scripts for Celestia in Lua and the .cel system
Topic author
startracker
Posts: 1
Joined: 13.11.2020
With us: 4 years

orientation observer in Earth equatorial frame

Post #1by startracker » 13.11.2020, 08:03

Dear Celestia Community,

I want to print the current orientation of the observer in celestia with respect to the Earth's equatorial frame.
The following script shall achieve this and it does print the quaternions on screen. However the values of the universal frame and the equatorial frame are always the same, yet they should not. The Earth's equator is tilted towards the ecliptic, therefore the quaternions should be different.

Note, that I try to print both the universal and the equatorial quaternions to compare them.

Code: Select all

tdbdate = celestia:gettime()
utctable = celestia:tdbtoutc(tdbdate)
obs = celestia:getobserver()
obs:setframe(celestia:newframe("universal"))
actual_obsrot = obs:getorientation()
earth = celestia:find("Sol/Earth")
frame = earth:equatorialframe()
obs:setframe(frame)
eq_obsrot = obs:getorientation()

celestia:print("Orientation:" .. "\nw: " .. actual_obsrot.w .. " Eq: " .. eq_obsrot.w .. "\nx: " .. actual_obsrot.x .. " Eq: " .. eq_obsrot.x .. "\ny: " .. actual_obsrot.y .. " Eq: " .. eq_obsrot.y .. "\nz: " .. actual_obsrot.z .. " Eq: " .. eq_obsrot.z .."\nTime jd:" .. tdbdate.. "\nTime utc: " .. utctable.year.."-"..utctable.month.."-"..utctable.day, 10.0, -1, -1, 2, 8)

wait(10.0) 


Image

I hope you can help me to solve this problem. Basically I want to figure out, how to change the observer frame from universal to equatorial.

Best regards
Startracker

Return to “Scripting”