|
![](/i/fill.gif) |
On Tue, 26 Mar 2002 10:40:41 -0600, "Shay" <sah### [at] simcoparts com> wrote:
>Povray finds the angle between two vectors like this like this: acos(min(1,
>vdot(vnormalize(V1), vnormalize(V2)))) What is the purpose of the min()?
acos is defined over [-1; 1] because no angle has a cosine greater
than 1. However, with computers, it is perfectly normal to have as a
result something like 1.0000000098345352 when you need 1, which, in
this case, will trigger a floating point exception. Hence the min.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |