POV-Ray : Newsgroups : povray.advanced-users : What... the hell...? : Re: What... the hell...? Server Time
28 Jul 2024 10:13:59 EDT (-0400)
  Re: What... the hell...?  
From: Mike Sobers
Date: 26 May 2006 18:40:00
Message: <web.447782ae7e4925a01009749b0@news.povray.org>
Orchid XP v2 <voi### [at] devnull> wrote:
> >>"atan2(A,B): Arc-tangent of (A/B). Returns the angle, measured in
> >>radians, whose tangent is (A/B). Returns appropriate value even if B is
> >>zero. Use atan2(A,1) to compute usual atan(A) function."
> >

> I just thought the whole point of using atan2 was to _avoid_ divide by
> zero errors.
>
> Oh well.


Yes, but not when A and B are BOTH zero.  Then the function is undefined.
You could simply do some error checking before trying to calculate the
function, and skip it altogether when A = B = 0.

Mike


Post a reply to this message

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