Page 1 of 1

Celx: difference between Position and Vector objects?

Posted: 22.04.2004, 21:09
by Rjp buisson
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

Re: Celx: difference between Position and Vector objects?

Posted: 22.04.2004, 22:26
by Harry
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

Re: Celx: difference between Position and Vector objects?

Posted: 23.04.2004, 04:41
by don
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:

Posted: 23.04.2004, 08:55
by Rjp buisson
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