|
![](/i/fill.gif) |
"Orchid XP v2" <voi### [at] dev null> wrote in message
news:441ea0bb@news.povray.org...
>>>"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."
>>
>>
>>>Um... yeah, OK... so why does atan2(0, 0) give we a fatal parse error?
>>
>>
>> Because the result is not defined. You are basically asking the
>> direction of a zero vector, which has none.
>
> I just thought the whole point of using atan2 was to _avoid_ divide by
> zero errors.
>
> Sure, if the vector has a length of zero it has no defined direction.
> OTOH, I would imagine in most cases it just wouldn't *matter* what number
> the function returns in this case - just so long as it returns something,
> rather than an error...
>
> Oh well.
Hi,
The easy workaround would be to put Slime's solution into your own macro
e.g. Orchidatan2(A,B) returning the angle.
Then, if you've got a lot of atan2 calls you can just do a global replace.
Regard,
Chris B.
Post a reply to this message
|
![](/i/fill.gif) |