Since I'm new to this development effort, I wanted to solicit any bits of advice before I checked in some code.
The code I'd like to checkin adds a new menu item titled "Start Logging" which is a toggleable menu item. This menu item will trigger code that begins logging some info to a file celeslog.log in the following format:
<Date and Time Stamp><tab><Currently selected object><tab><Distance to object><carriage return>
Basically this grew out of my desire to follow halley's commet around, and get a file of the distance to Earth. Then I could sort that file in Excel to find out in what year will Halley come closest to Earth.
I'd like to evolve the code into a full logging subsystem so that the user can enter a format string like:
&date&tab&sel&tab&dist&cr
into a config screen box and have celestia output the requested information to a file. Possible format codes could be:
&date - Date and time string
&sel - Current selection name
&dist - Distance to currently selected object
&tab - Insert a tab
&cr - Insert a carriage return
&vel - Velocity
&dayl - Day length of currently selected object
This way, as the simulation blazes by at 1000000x speed, we can get a record of what went on.
Any comments on this attempt would be appreciated
blu
Announcement of Intent to checkin code
-
- Posts: 104
- Joined: 07.06.2002
- With us: 22 years 5 months
- Location: Redmond, WA
If you run the simulation at 1000000x, won't your sample rate be too low? You can only output to the log once a frame and, at that time scale, you won't get continuous data. Halley will likely fly right past the closest point, perhaps multiple times, without a single log.
As far as I know, Celestia doesn't actually model orbits with velocity, but rather the Keplerian formula that is parameterized by time. That is, something to the effect of:
Position = KeplerianOrbit( JulianDate )
A more practical solution to the problem might be to just mathematically solve for the shortest distance between the two objects, using the formulas for their respective orbits. I don't know how difficult or easy this would be, but it seems like it could be done.
- a b i o g e n e s i s -
As far as I know, Celestia doesn't actually model orbits with velocity, but rather the Keplerian formula that is parameterized by time. That is, something to the effect of:
Position = KeplerianOrbit( JulianDate )
A more practical solution to the problem might be to just mathematically solve for the shortest distance between the two objects, using the formulas for their respective orbits. I don't know how difficult or easy this would be, but it seems like it could be done.
- a b i o g e n e s i s -
-
- Posts: 62
- Joined: 16.09.2002
- With us: 22 years 2 months
- Location: Phoenix, Arizona
Makes sense.
That makes sense, and would indeed be more accurate wouldn't it. :-) I wonder if this approach would work for custom orbits eventually.
Anyhoo. Anyone have suggestions for other uses for an logging system for celestia?
blu
Anyhoo. Anyone have suggestions for other uses for an logging system for celestia?
blu