[Kstars-devel] kdeedu/kstars/kstars/tools
Pablo de Vicente
p.devicente at wanadoo.es
Wed May 12 13:28:52 CEST 2004
CVS commit by pvicente:
Added a new calculator module which computes the ecliptic heliocentric, ecliptic geocentric,
equatorial geocentric and topocentric coordinates of the nine planets of the solar system,
plus the Sun and the Moon for a given date and time and a certain location on the
surface of the Earth. Only the coordinates for the selected body are shown.
The new module is under a new item which I have called "Solar System" and which in the future
may be populated with more submodules concerning computations on solar system bodies:
moon phases, planet phases, Moons of other planets, eclipses, transits....
The module, as with most of the rest of the other calculator modules has two
modes: interactive and batch mode.
The interactive mode is fully operative, but shows incorrect results for Pluto and the Moon.
I am not sure if the approach I have undertaken is the best one. Now, what I do is to
create one KSPlanet (For Mercury to Neptune) or KSMoon (for the Moon), KSSun, or KPluto
depending on the object selected in the ComboBox. All of them are child classes of
KSPlanetBase. Then I call:
ksp->findPosition(num, position->lat(), LST, Earth);
ksp->EquatorialToHorizontal(position->lat(), LST);
.... to obtain the solar system body position in different coordinate systems for
a given position on the Earth and for a given time.
This philosophy requires to have lots of if ... elseif and to call for each
of them the same functions, which somehow does not look very effective.
Since the batch mode is not operative yet, and this philosophy is more difficult
to implement for the batch mode without repeating the same code again, I am thinking
on creating a PlanetCatalog object, compute the positions for all planets but only show
those for the chosen solar system body.
I could have done everything before committing, but since the current model works, I feel
more comfortable committing it now to the CVS and will make modifications later. The
batch mode UI is designed and ready and the code is almost ready; only the function which
is triggered by the compute button is not complete yet.
CCMAIL: kstars-devel at kde.org
A modcalcplanets.cpp 1.1 [GPL (v2+)]
A modcalcplanets.h 1.1 [GPL (v2+)]
A modcalcplanetsdlg.ui 1.1
M +1 -1 Makefile.am 1.6
M +41 -2 astrocalc.cpp 1.26
M +9 -2 astrocalc.h 1.17
More information about the Kstars-devel
mailing list