POV-Ray : Newsgroups : povray.advanced-users : Does wrapping atan2(0,0) avoid the domain error? : Re: Does wrapping atan2(0,0) avoid the domain error? Server Time
24 Apr 2024 22:21:10 EDT (-0400)
  Re: Does wrapping atan2(0,0) avoid the domain error?  
From: kurtz le pirate
Date: 9 Dec 2022 12:36:11
Message: <6393720b$1@news.povray.org>
On 05/12/2022 20:48, Cousin Ricky wrote:
> I have a situation where it is possible to pass zero as both arguments
> to atan2(), which is the one case where the function fails.  But while
> attempting to find a workaround for this situation, I discovered that
> simply calling atan2(0,0) from within a user-defined function avoids the
> domain error!
> 
> I don't know whether this is intended POV-Ray behavior or just a fluke
> of my computer OS.
> 
> Can you all try the following scene file with -F and report what the
> message window says, along with your operating system and POV version?
> My system writes 0.000000 for the first line, and fails on the second.
> I'd like to know if this is consistent behavior across all operating
> systems.  Or perhaps Chris or Thorsten can tell us if this is intended
> behavior?
> 
> ----------[BEGIN CODE]----------
> #version max (3.5, min (3.8, version));
> global_settings { assumed_gamma 1 }
> #declare fn_Atan2 = function (y, x) { atan2 (y, x) }
> #debug concat ("atan2 (0,0) with wrapper = ", str (fn_Atan2 (0,0), 0,
> 6), "\n")
> #debug concat ("bare atan2 (0,0) = ", str (atan2 (0,0), 0, 6), "\n")
> -----------[END CODE]-----------
> 


Further details here :
<http://news.povray.org/povray.general/thread/%3C616bfd9d%241%40news.povray.org%3E/?ttop=438714&toff=50>




-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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