Has anyone written a Lua function to convert a position vector in Celestia's internal cartesian coordinate system to polar coordinates?
In particular, from x,y,z to RA, Dec, distance?
(which will be different depending on the viewpoint; e.g. the same object will have different RA,Dec, distance as the viewpoint moves around it.)
Vincent, is there one in the Lua Edu Tools?
Celestia xyz to Ra, Dec function?
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Selden,
You might want to have a look at the utils/celutil.lua file in the Lua Edu Tools package, at the '-- Return current Ra, Dec for selection' section. You'll certainly need to modify this piece of code to make it suit your needs. Let me know then if you need some more help.
You might want to have a look at the utils/celutil.lua file in the Lua Edu Tools package, at the '-- Return current Ra, Dec for selection' section. You'll certainly need to modify this piece of code to make it suit your needs. Let me know then if you need some more help.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorselden
- Developer
- Posts: 10192
- Joined: 04.09.2002
- With us: 22 years 2 months
- Location: NY, USA
Vincent,
The only substantive change I had to make was to change the reference to pkg.EARTH to be a reference to the viewpoint position. You might want to consider something like that for the EduTools, too, since otherwise the RA and Dec calculated for near-Earth satellites will be wrong: the observer's viewpoint isn't at the center of the Earth.
The only substantive change I had to make was to change the reference to pkg.EARTH to be a reference to the viewpoint position. You might want to consider something like that for the EduTools, too, since otherwise the RA and Dec calculated for near-Earth satellites will be wrong: the observer's viewpoint isn't at the center of the Earth.
Selden