POV-Ray : Newsgroups : povray.bugreports : atan2 problem : Re: atan2 problem Server Time
18 Jun 2024 08:23:06 EDT (-0400)
  Re: atan2 problem  
From: Ron Parker
Date: 14 Oct 1998 10:41:19
Message: <3624a9ff.0@news.povray.org>
On Wed, 14 Oct 1998 11:44:43 +0200, Axel Baune 
	<aba### [at] neuroinformatikuni-ulmde> wrote:

>If you use atan2 the renderer reports a error in the case for the
>Parameters A and B are zero (i.e. atan (0,0) ) In the previous version
>of Pov (3.02) this error did't occur, here atan2(0,0) calculates to 0.

This sounds like a bug in 3.02 rather than in 3.1.  atan2(0,0) doesn't make
any sense, either mathematically (what is 0/0?) or geometrically (what is
the angle of a vector of zero length?).  Simply put, it SHOULD report an 
error.  If you don't want it to, create a macro like

#macro my_atan2( YY, XX ) 
  #if (YY = 0 & XX = 0 )
    0
  #else
    atan2( YY,XX )
  #end
#end

and use that instead.


Post a reply to this message

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