Celx: difference between Position and Vector objects?

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Rjp buisson
Posts: 31
Joined: 18.03.2002
With us: 22 years 8 months
Location: Paris France

Celx: difference between Position and Vector objects?

Post #1by Rjp buisson » 22.04.2004, 21:09

In Lua-Celx programming:

Is a 'position' object the same class as a 'vector' ???
Do the same methods apply to both of them?
If not, WHAT is exactly a Position object?
Thanks

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Re: Celx: difference between Position and Vector objects?

Post #2by Harry » 22.04.2004, 22:26

Rjp buisson wrote:In Lua-Celx programming:

Is a 'position' object the same class as a 'vector' ???
Do the same methods apply to both of them?
If not, WHAT is exactly a Position object?

Today must be the record for the number of CELX-related questions 8O

Position and Vector are similar, but not the same. Both contain three components, but with different precision - a Position contains three 128-Bit numbers, which is enough to cover the universe up to ~1e19 ly (?) away from our Sun with uniformly high precision. A vector is made of three double-precision floating point numbers, which makes the precision suffer for very long vectors.

You should think of a vector as pointing from one position to another (e.g. if you compute the difference between two positions in CELX, the result will be a vector). However sometimes it makes sense to (mis)use one for the other.

Harald

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Re: Celx: difference between Position and Vector objects?

Post #3by don » 23.04.2004, 04:41

Harry wrote:Today must be the record for the number of CELX-related questions 8O

We just didn't want you to feel left out Harald. :lol:
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
Rjp buisson
Posts: 31
Joined: 18.03.2002
With us: 22 years 8 months
Location: Paris France

Post #4by Rjp buisson » 23.04.2004, 08:55

Hi Harry
Hello Don
Thanks a lot for your prompt answers.
You do make a great job watching and answering our mail..
Clear skyes to you.
JPierre


Return to “Scripting”