POV-Ray : Newsgroups : povray.general : I have a problem with atan2() : Re: I have a problem with atan2() Server Time
6 Dec 2021 13:26:43 EST (-0500)
  Re: I have a problem with atan2()  
From: Kenneth
Date: 19 Oct 2021 06:50:00
Message: <web.616ea197f55768364cef624e6e066e29@news.povray.org>
The Wikipedia page about atan2 (and some of the references cited there) give me
the impression that there is no truly *standard* way of implementing the
function.

"The realization of the function differs from one computer language to another."

Hmm, that doesn't sound good.

"The C function atan2, and most other computer implementations, are designed
to...always define atan2(0, 0). On implementations without signed zero, or when
given positive zero arguments, it is normally defined as 0. It will always
return a value...rather than raising an error or returning a NaN (Not a
Number)."

However...
"For systems implementing signed zero, infinities, or Not a Number (for example,
IEEE floating point)...these *may* return NaN or raise an exception when given a
NaN argument."

Then it gets more complex-- with such stuff as real vs. imaginary-and/or-complex
numbers, "undefined" vs. "indeterminate" values, "signed 0" vs. "unsigned 0",
the two arguments sometimes being reversed, etc.

Various programs and computer languages handle the atan2(0,0) problem in
different ways-- and with different outcomes(!)

Much of this stuff is way over my head, as I am a NaM
(Not-a-Mathematician :-P ),
but the overall situation is surprising to me. And some of the explanations
border on the realm of mathematical 'philosophy'.


Post a reply to this message

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