POV-Ray : Newsgroups : povray.newusers : Atan function Server Time
31 Oct 2024 19:33:36 EDT (-0400)
  Atan function (Message 1 to 5 of 5)  
From: kevva
Subject: Atan function
Date: 8 Nov 2014 11:40:01
Message: <web.545e463b3b2a82ebb96413000@news.povray.org>
HI Guys
When using the Atan2(x,y) function I get a domain error when one or both of the

any way. What Am I missing?


Post a reply to this message

From: Doctor John
Subject: Re: Atan function
Date: 8 Nov 2014 12:54:23
Message: <545e58cf$1@news.povray.org>
On 08/11/14 16:35, kevva wrote:
> HI Guys
> When using the Atan2(x,y) function I get a domain error when one or both of the

> any way. What Am I missing?
> 
> 
> 

I'm probably wrong (I usually am) but my reading of the docs says that
atan(a, b) says that atan will return a correct number when 'b' is zero;
it says nothing about 'a'.
What exactly are you trying to do? A code snippet would help.

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: kevva
Subject: Re: Atan function
Date: 8 Nov 2014 13:05:01
Message: <web.545e5b25464ead14b96413000@news.povray.org>
Doctor John <j.g### [at] gmailcom> wrote:
> On 08/11/14 16:35, kevva wrote:
> > HI Guys
> > When using the Atan2(x,y) function I get a domain error when one or both of the

> > any way. What Am I missing?
> >
> >
> >
>
> I'm probably wrong (I usually am) but my reading of the docs says that
> atan(a, b) says that atan will return a correct number when 'b' is zero;
> it says nothing about 'a'.
> What exactly are you trying to do? A code snippet would help.
>
> John
> --
> Protect the Earth
> It was not given to you by your parents
> You hold it in trust for your children

Hi John
You may be right, I have an object that might just pass over the X/Y axis making
that var 0. I have written a cludge that uses the atan() when a zero is
detected. It works but it is messy!.

I my self do not have an internet connection right now so a mate Kevva has
helped me out with this. So a code example might just take me a couple of days
to get, but thanks for the advice.


Post a reply to this message

From: Doctor John
Subject: Re: Atan function
Date: 8 Nov 2014 13:37:05
Message: <545e62d1$1@news.povray.org>
On 08/11/14 18:04, kevva wrote:
> 
> Hi John
> You may be right, I have an object that might just pass over the X/Y axis making
> that var 0. I have written a cludge that uses the atan() when a zero is
> detected. It works but it is messy!.
> 
> I my self do not have an internet connection right now so a mate Kevva has
> helped me out with this. So a code example might just take me a couple of days
> to get, but thanks for the advice.

No problem. I'm willing to bet that you'll have a solution before then;
but if you don't, feel free to come back here.

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: Warp
Subject: Re: Atan function
Date: 10 Nov 2014 14:04:59
Message: <54610c5a@news.povray.org>
kevva <gli### [at] hotmailcom> wrote:
> When using the Atan2(x,y) function I get a domain error when one or both of the
> vars goes to zero. Yet the ?Help? says that ?it  will return the correct numbers
> any way. What Am I missing?

Normally atan2() should malfunction only if both parameters are zero
(because a zero vector has no defined angle). Are you sure that's not
the case here?

-- 
                                                          - Warp


Post a reply to this message

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