RE: [AD] div-by-zero... math3d.c |

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]

*To*: "'alleg-developers@xxxxxxxxxx'" <alleg-developers@xxxxxxxxxx>*Subject*: RE: [AD] div-by-zero... math3d.c*From*: Vincent Penquerc'h <Vincent.Penquerch@xxxxxxxxxx>*Date*: Mon, 17 Mar 2003 15:48:37 -0000

Title:

> I think you are right about the zero vector, we may well leave the

> result undefined. But I also think the current

> implementation may give

> strange results for vectors close to but different from zero,

> because if

> their squares are zero then vector_length() returns zero. What about

> the following algorithm:

[...]

Ah yes, this is something kinda something I saw in Numerical Recipes

in C. That'd certainly be helpful. Also, since it's often the case

that normalization is used, in fact, as renormalization (eg only for

vectors which are almost normalized already), I remember seeing yet

another trick, that is faster, but only works with almost normalized

vectors (and the precision is worse, too). I can't remember the kind

of speedup it offered though. Could be interesting to add, maybe ?

--

Vincent Penquerc'h

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [AD] div-by-zero... math3d.c** - Next by Date:
**Re: [AD] div-by-zero... math3d.c** - Previous by thread:
**Re: [AD] div-by-zero... math3d.c** - Next by thread:
**RE: [AD] div-by-zero... math3d.c**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |