What are the all of the exact measurements used for Celestia?
Meaning, exactly how many kilometers is one AU, and exactly how many days is one year, and so forth?
I read the answer to those questions somewhere, but I forget where.
Exact Measurements in Celestia
Forum rules
Please help to make this forum more useful by checking the FAQs before posting! Keep it clean, keep it civil, keep it truthful, stay on topic, be responsible, share your knowledge.
Please help to make this forum more useful by checking the FAQs before posting! Keep it clean, keep it civil, keep it truthful, stay on topic, be responsible, share your knowledge.
-
Topic authorPlutonianEmpire
- Posts: 1374
- Joined: 09.09.2004
- Age: 40
- With us: 20 years 2 months
- Location: MinneSNOWta
- Contact:
Exact Measurements in Celestia
Terraformed Pluto: Now with New Horizons maps! :D
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Re: Exact Measurements in Celestia
PlutonianEmpire wrote:What are the all of the exact measurements used for Celestia?
Meaning, exactly how many kilometers is one AU, and exactly how many days is one year, and so forth?
I read the answer to those questions somewhere, but I forget where.
One amazing implication is that after time run over centuries in Celestia, the planets are still at the right place in the sky...
Fridger
Re: Exact Measurements in Celestia
The values can be found in Celestia's source code on SourceForge.
http://celestia.svn.sourceforge.net/vie ... estia/src/
Most of them are in either astro.h or astro.cpp
Here are a few:
src/celengine/astro.cpp:const double astro::speedOfLight = 299792.458; // km/s
src/celengine/astro.h:#define KM_PER_LY 9460730472580.8
src/celengine/astro.h:#define KM_PER_AU 149597870.7
src/celengine/astro.h:#define LY_PER_PARSEC 3.26167
For a long time Celestia was using this value:
src/celengine/astro.h:// #define OLD_KM_PER_LY 9466411842000.000
The number of days in a Terrestrial year is hardwired in the code in many places: 365.25
Fridger,
When writing Lua orbital and rotation routines, one needs to use exactly the same values as Celestia is using. Too often, they are not the same as what one finds when searching with Google. The number of kilometers in an AU is one example.
http://celestia.svn.sourceforge.net/vie ... estia/src/
Most of them are in either astro.h or astro.cpp
Here are a few:
src/celengine/astro.cpp:const double astro::speedOfLight = 299792.458; // km/s
src/celengine/astro.h:#define KM_PER_LY 9460730472580.8
src/celengine/astro.h:#define KM_PER_AU 149597870.7
src/celengine/astro.h:#define LY_PER_PARSEC 3.26167
For a long time Celestia was using this value:
src/celengine/astro.h:// #define OLD_KM_PER_LY 9466411842000.000
The number of days in a Terrestrial year is hardwired in the code in many places: 365.25
Fridger,
When writing Lua orbital and rotation routines, one needs to use exactly the same values as Celestia is using. Too often, they are not the same as what one finds when searching with Google. The number of kilometers in an AU is one example.
Selden
-
Topic authorPlutonianEmpire
- Posts: 1374
- Joined: 09.09.2004
- Age: 40
- With us: 20 years 2 months
- Location: MinneSNOWta
- Contact:
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Re: Exact Measurements in Celestia
selden wrote:
Fridger,
When writing Lua orbital and rotation routines, one needs to use exactly the same values as Celestia is using. Too often, they are not the same as what one finds when searching with Google. The number of kilometers in an AU is one example.
Selden,
I actually misunderstood the English of that question. Apart from that, it's always bad to take ones information about such things from Google, at least without knowing the author who wrote it...Fortunately, one still cannot write a PhD with Google
Fridger
-
Topic authorPlutonianEmpire
- Posts: 1374
- Joined: 09.09.2004
- Age: 40
- With us: 20 years 2 months
- Location: MinneSNOWta
- Contact:
Re: Exact Measurements in Celestia
Sorry for gravedigging, but...
"365.25," is that the exact number that celestia uses, or is it something slightly greater or slightly less? I've looked around, but couldn't find it.selden wrote:The number of days in a Terrestrial year is hardwired in the code in many places: 365.25
Terraformed Pluto: Now with New Horizons maps! :D
Re: Exact Measurements in Celestia
What do you mean by "looked around"?
In Celestia's source code or somewhere else?
it's in many of Celestia source files.
In Celestia's source code or somewhere else?
it's in many of Celestia source files.
and that's just the first page of grep's output....$ grep 365.25 */*.cpp | more
celengine/astro.cpp: int64 d = (int64) floor((c - 122.1) / 365.25);
celengine/astro.cpp: int64 e = (int64) floor(365.25 * d);
celengine/astro.cpp: return (floor(365.25 * y) +
celengine/customorbit.cpp: return 365.25;
celengine/customorbit.cpp: m2 = jd19/365.2596407;
celengine/customorbit.cpp: double T = t / 365.25;
celengine/customorbit.cpp: double T = t / 365.25;
celengine/customorbit.cpp: double D = d / 365.25; // years
celengine/customorbit.cpp: t2 = t1 / 365.25;
celengine/customorbit.cpp: t3 = (t - 2433282.423) / 365.25 + 1950.0;
celengine/customorbit.cpp: t5 = t4 / 365.25;
celengine/customorbit.cpp: t8 = t6 / 365.25;
celengine/customorbit.cpp: t9 = (t - 2442000.5) / 365.25;
celengine/customorbit.cpp: double T = t / 365.25;
celengine/customorbit.cpp: double theta = degToRad(151.401 + 0.57806 * t
/ 365.25);
celengine/customorbit.cpp: return CreateJPLEphOrbit(JPLEph_Mercury, JPLEp
h_Sun, 0.2408 * 365.25, 6.0e7);
celengine/customorbit.cpp: return CreateJPLEphOrbit(JPLEph_Venus, JPLEp
h_Sun, 0.6152 * 365.25, 1.0e8);
Selden
-
Topic authorPlutonianEmpire
- Posts: 1374
- Joined: 09.09.2004
- Age: 40
- With us: 20 years 2 months
- Location: MinneSNOWta
- Contact:
Re: Exact Measurements in Celestia
I looked around in files in that link you gave me. I was using "year" and "days" as the search term.selden wrote:What do you mean by "looked around"?
In Celestia's source code or somewhere else?
it's in many of Celestia source files.and that's just the first page of grep's output....$ grep 365.25 */*.cpp | more
celengine/astro.cpp: int64 d = (int64) floor((c - 122.1) / 365.25);
celengine/astro.cpp: int64 e = (int64) floor(365.25 * d);
celengine/astro.cpp: return (floor(365.25 * y) +
celengine/customorbit.cpp: return 365.25;
celengine/customorbit.cpp: m2 = jd19/365.2596407;
celengine/customorbit.cpp: double T = t / 365.25;
celengine/customorbit.cpp: double T = t / 365.25;
celengine/customorbit.cpp: double D = d / 365.25; // years
celengine/customorbit.cpp: t2 = t1 / 365.25;
celengine/customorbit.cpp: t3 = (t - 2433282.423) / 365.25 + 1950.0;
celengine/customorbit.cpp: t5 = t4 / 365.25;
celengine/customorbit.cpp: t8 = t6 / 365.25;
celengine/customorbit.cpp: t9 = (t - 2442000.5) / 365.25;
celengine/customorbit.cpp: double T = t / 365.25;
celengine/customorbit.cpp: double theta = degToRad(151.401 + 0.57806 * t
/ 365.25);
celengine/customorbit.cpp: return CreateJPLEphOrbit(JPLEph_Mercury, JPLEp
h_Sun, 0.2408 * 365.25, 6.0e7);
celengine/customorbit.cpp: return CreateJPLEphOrbit(JPLEph_Venus, JPLEp
h_Sun, 0.6152 * 365.25, 1.0e8);
My apologies.
Terraformed Pluto: Now with New Horizons maps! :D
- Chuft-Captain
- Posts: 1779
- Joined: 18.12.2005
- With us: 18 years 11 months
Re: Exact Measurements in Celestia
I worry that this literal value is hard-coded in so many places. Best practice would be to declare it once only (for example as days_in_year )and then use that variable/attribute in all these places.selden wrote:What do you mean by "looked around"?
In Celestia's source code or somewhere else?
it's in many of Celestia source files.
I wonder if a re-factoring of this has ever been attempted?
CC
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)
CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS
-- Gerard K. O'Neill (1969)
CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS
- Hungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Re: Exact Measurements in Celestia
Chuft-Captain wrote:Best practice would be to declare it once only (for example as days_in_year )and then use that variable/attribute in all these places.
That would certainly make the value easier to modify later if the need ever arises.
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics