POV-Ray : Newsgroups : povray.general : I have a problem with atan2() : Re: I have a problem with atan2() Server Time
6 Dec 2021 13:19:40 EST (-0500)
  Re: I have a problem with atan2()  
From: Alain Martel
Date: 17 Oct 2021 11:56:58
Message: <616c47ca$1@news.povray.org>
Le 2021-10-17 à 06:40, kurtz le pirate a écrit :
> 
> Hello,
> 
> I have a problem with  atan2(a,b) when b = zero.
> 
> The documentation on the page 
> <http://www.povray.org/documentation/view/3.7.1/228/> says :
> 
> Arc-tangent of (A/B). Returns the angle, measured in radians, whose 
> tangent is (A/B). **Returns appropriate value even if B is zero**
> 
> In my case, i get : Parse Error: Domain error in atan2!
> 
> So it's up to me to test if b=zero and return the appropriate value ?
> 
> 
> 

A/B is undefined when B = 0.
So, «Parse Error: Domain error in atan2» is the appropriate value when B 
is zero.
The appropriate value when B is zero would be plus AND minus infinity.


Post a reply to this message

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