Re: Length calculation

"Oleh Derevenko" <[email protected]> Thu, 11 Oct 2007 19:47:52 +0300
Newsgroups gmane.comp.lib.ode
Message-ID <[email protected]>
Why? Multiplications and divisions do not introduce substantial error. At 
the same time, length calculation, as seen from dNormalize3, is much more 
precise after you divide by largest vector component.

Maybe you did not understand my explanation correctly? I suggest the 
following:

Let V = (vx, vy, vz). Let |vx| >= |vy| and |vx| >= |vz| and vx != 0.
Then calculate |V| as |vx| * sqrt((vy/vx)^2 + (vz/vx)^2 + 1)

----- Original Message ----- 
From: "Jon Watte (ODE)" <[email protected]>
To: "Oleh Derevenko" <[email protected]>
Cc: <[email protected]>
Sent: 11 жовтня 2007 р. 19:38
Subject: Re: [ODE] Length calculation


>
>
> Oleh Derevenko wrote:
>> Did not you think about changing dLength3() to use the same approach as 
>> dNormalize3() does? If there is a noticeable error in vector length after 
>> straight normalization via division by square root of vector component 
>> squares sum, that error comes from length calculation and hence, is 
>> present in result of dLength3().
>> What about calculating a vector length as product of largest vector 
>> component by length of vector after division by that largest component?
>
> If you do a simple floating point error analysis, you'll quickly realize 
> that that will just introduce more errors. The reason you can do better in 
> normalize, is that the target (1.0) is well known and well defined.
>
> Cheers,
>
>          / h+
>
>
> 


_______________________________________________
ODE mailing list
[email protected]
http://ode.org/mailman/listinfo/ode