POV-Ray : Newsgroups : povray.general : I have a problem with atan2() : Re: I have a problem with atan2() Server Time
6 Dec 2021 11:41:33 EST (-0500)
  Re: I have a problem with atan2()  
From: kurtz le pirate
Date: 18 Oct 2021 11:42:41
Message: <616d95f1$1@news.povray.org>
On 17/10/2021 23:46, Cousin Ricky wrote:

> ... 
> Of course, the inverse tangent of A/0 is undefined, because A/0 is
> undefined.  But a simple limits exercise, as well as the very definition
> of the tangent of an angle, show that these undefined tangents
> correspond to the angles pi/2 and -pi/2, and it is therefore useful to
> pretend that they are valid.
> 
> The purpose of atan2() is to handle these special cases, by converting a
> naive atan()'s argument into an ordered pair, thus allowing the would-be
> inverse tangent of A/0 to be computed without having to divide by 0.  A
> simple scene file shows that the *only* time atan2() fails with a domain
> error is when *both* A and B are zero.  Of course, (0, 0) is an
> indeterminate case, for which returning a value would be nonsensical.
> ...

Cousin Ricky is right about everything!

And therefore, my problem is when A AND B are equal to zero.

Lot of datas to deal with, the debugging will be long...
(i'm working on the visualization of complex functions with domain coloring)



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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