POV-Ray : Newsgroups : povray.off-topic : Ray tracers and transformations : Re: Ray tracers Server Time
10 Oct 2024 17:17:46 EDT (-0400)
  Re: Ray tracers  
From: Warp
Date: 14 Mar 2008 03:52:27
Message: <47da3cca@news.povray.org>
Severi Salminen <sev### [at] notthissaunalahtifiinvalid> wrote:
>         double nearPoint = nearestPointDistance - sqrt(halfChord2);
>         double farPoint = nearestPointDistance + sqrt(halfChord2);

  Perhaps you shouldn't rely on the ability of the compiler to realize
that the exact same sqrt() is being performed here, and instead calculate
it only once into a variable. That way you remove the risk of the
code actually calculating the slow sqrt() twice for no reason.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.