X,Y,Z Coords
Posted: 05.10.2005, 14:03
Is there a way to select an object and get it's X,Y,Z coordinates where the Sun is 0,0,0?
Real-time 3D visualization of space
https://celestiaproject.space/forum/
https://celestiaproject.space/forum/viewtopic.php?f=2&t=8076
Code: Select all
function celestia_keyboard_callback(input)
local response = false
if input == "1" then
factor = AU_PER_uLY
units = "AU"
response = true
elseif input == "2" then
factor = 1 / 1000000
units = "LY"
response = true
elseif input == "3" then
factor = 1 / 3262000
units = "pc"
response = true
end
return response
end -- celestia_keyboard_callback()
celestia:flash("Solar Coordinates - C. Pottinger\n" ..
"select an object and press a unit of scale:\n" ..
"1=AU 2=LY 3=pc", 4);wait(4)
KM_PER_AU = 149597870.7
KM_PER_uLY = 9466411.842
AU_PER_uLY = (KM_PER_uLY / KM_PER_AU)
POS_SOL = celestia:find("Sol"):getposition()
selected = celestia:getselection()
units = ""
celestia:requestkeyboard(true)
while true do
selected = celestia:getselection()
if selected ~= nil and units ~= "" then
d = selected:getposition():distanceto(POS_SOL)
x = selected:getposition():getx() - POS_SOL:getx()
y = selected:getposition():gety() - POS_SOL:gety()
z = selected:getposition():getz() - POS_SOL:getz()
celestia:flash("For " .. selected:name() .. " (d = " .. d * factor / KM_PER_uLY .. " " .. units .. ")\n" ..
" X = " .. x * factor .. " " .. units .. "\n" ..
" Y = " .. y * factor .. " " .. units .. "\n" ..
" Z = " .. z * factor .. " " .. units, 5)
end
wait(1)
end
selden wrote:You left out one coordinate system
Ecliptic
selden wrote:Ecliptic is relative to the plane of the planetary orbits around the sun.
It's essentially the same as Equatorial, but does not include the 23.5 degree rotation due to the tilt of the Earth's axis.
Malenfant wrote:Odd. When we see stars from Earth's surface then we're seeing them in the Equatorial frame by default. What do we gain by measuring them relative to Earth's orbit?
Are ecliptic coords still measured as RA/Dec? If so, how do you tell them apart from equatorial?
cpotting wrote:Eliminating a galactic oriented system was also a no-brainer since the origin is some 34 or so pc above the galactic plane.
Also remember, bigtim was looking for a way to describe an object's position relative to the Sun, hence X Y Z coordinates. RA/Dec tells you tje direction to an object, not the position of the object. It is the difference between having someone tell you that you have to "go three blocks east and two blocks north" and someone else pointing and saying that "its that way". "that way" doesn't tell WHERE it is, just in what direction it lays.
cpotting wrote:Try this script
rthorvald wrote:... Trying to run this in OSX returns a "fatal error", whereupon Celestia tries to quit (dirkpitt??s latest unofficial version).
Other CELX-scripts works fine...
Malenfant wrote:Eh? I thought the origin for galactic coordinates was the Sun? (at least, that's how the spreadsheet calculates them)
Malenfant wrote:Also remember, bigtim was looking for a way to describe an object's position relative to the Sun, hence X Y Z coordinates. RA/Dec tells you tje direction to an object, not the position of the object. It is the difference between having someone tell you that you have to "go three blocks east and two blocks north" and someone else pointing and saying that "its that way". "that way" doesn't tell WHERE it is, just in what direction it lays.
Well you also need the parallax so you can calculate the distance. But you need that for any coordinate system.
selden wrote:The IAU's galactic coordinate system currently used by astronomers is centered on the Earth/Sun, with coordinates l2 and b2 on the sky.
One summary of astronomical coordinate systems is at
http://www.ess.sunysb.edu/fwalter/PHY515/coords.html
Accept no substitutes.
. I was simply talking about an X Y Z system where the X-Z plane would be aligned with the "equator" of the galaxy. I was saying, that I realised that that is not what bigtim wanted since the an X-Z plane aligned with the "equator" of the galaxy and with the Sun at the origin would result in the X-Z plane being some 34 or so parsecs "above" of the galaxy's "equator" and thus not a very useful "galactic oriented system".Eliminating a galactic oriented system