POV-Ray : Newsgroups : povray.general : Dumb trig question Server Time
24 Nov 2024 01:22:33 EST (-0500)
  Dumb trig question (Message 1 to 7 of 7)  
From: Mike Horvath
Subject: Dumb trig question
Date: 28 Mar 2021 18:20:46
Message: <6061013e$1@news.povray.org>
I want an animation of a circle whose radius starts at x and ends up at 
infinity. If x were zero then I would use `tan(clock*pi/2)`. But x is 
not zero. What should I use instead? Please answer my dumb maths 
question, thanks.

Mike


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Dumb trig question
Date: 28 Mar 2021 18:56:08
Message: <60610988$1@news.povray.org>
On 21/03/29 00:20, Mike Horvath wrote:
> I want an animation of a circle whose radius starts at x and ends up at 
> infinity. If x were zero then I would use `tan(clock*pi/2)`. But x is 
> not zero. What should I use instead? Please answer my dumb maths 
> question, thanks.
> 
> Mike


(1-1/(1-clock))-(1-x)


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Dumb trig question
Date: 28 Mar 2021 19:00:24
Message: <60610a88$1@news.povray.org>
On 21/03/29 00:56, Zeger Knaepen wrote:
> On 21/03/29 00:20, Mike Horvath wrote:
>> I want an animation of a circle whose radius starts at x and ends up 
>> at infinity. If x were zero then I would use `tan(clock*pi/2)`. But x 
>> is not zero. What should I use instead? Please answer my dumb maths 
>> question, thanks.
>>
>> Mike
> 
> 
> (1-1/(1-clock))-(1-x)

you could also use tan, starting at atan(x) going to pi/2

Or log(1-clock)+x

Any function that goes to infinity at a known point could be used, I 
suppose, but those are the three I can think of.


Post a reply to this message

From: Mike Horvath
Subject: Re: Dumb trig question
Date: 28 Mar 2021 19:18:35
Message: <60610ecb$1@news.povray.org>
On 3/28/2021 7:00 PM, Zeger Knaepen wrote:
> you could also use tan, starting at atan(x) going to pi/2

You mean this?

tan(clock * (pi/2 - atan(x)) + atan(x))

Not sure what to do.


Mike


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Dumb trig question
Date: 28 Mar 2021 19:52:32
Message: <606116c0$1@news.povray.org>
On 21/03/29 01:18, Mike Horvath wrote:
> On 3/28/2021 7:00 PM, Zeger Knaepen wrote:
>> you could also use tan, starting at atan(x) going to pi/2
> 
> You mean this?
> 
> tan(clock * (pi/2 - atan(x)) + atan(x))
> 
> Not sure what to do.

you want a function that starts at x at clock=0 and goes to infinity at 
clock=1, and for some reason you want to use tan() :)

you have:

tan(u)=x <=> atan(x)=u
and tan(v)=infinity <=> v=pi/2

but you want tan(f(clock)) with f(clock) a function that gives you the 
desired results.

So you need to convert clock (which goes from 0 to 1) to the range 
atan(x) -> pi/2

Let's figure this out:
you can't just add atan(x) to clock, or it would go from atan(x) to 
1+atan(x)

So you also have to scale the clock-value.
Let's do that first, the range should be between atan(x) and pi/2, and 
we know that atan(x) is smaller than pi/2.
So the difference is (pi/2)-atan(x), that is the scale. The offset is 
indeed atan(x)

So we get: fClock=((pi/2)-atan(x))*clock+atan(x)

and then tan(fClock) should give you the desired result.

I think.

:)


I haven't used POV-Ray in a while, so you might have to translate some 
parts into POVese


Post a reply to this message

From: Mike Horvath
Subject: Re: Dumb trig question
Date: 28 Mar 2021 20:16:40
Message: <60611c68$1@news.povray.org>
On 3/28/2021 7:52 PM, Zeger Knaepen wrote:
> So we get: fClock=((pi/2)-atan(x))*clock+atan(x)
> 
> and then tan(fClock) should give you the desired result.
> 
> I think.

I think that's the same as what I came up with.


Mike


Post a reply to this message

From: Alain Martel
Subject: Re: Dumb trig question
Date: 29 Mar 2021 12:01:18
Message: <6061f9ce$1@news.povray.org>
Le 2021-03-28 à 18:20, Mike Horvath a écrit :
> I want an animation of a circle whose radius starts at x and ends up at 
> infinity. If x were zero then I would use `tan(clock*pi/2)`. But x is 
> not zero. What should I use instead? Please answer my dumb maths 
> question, thanks.
> 
> Mike

This one goes from 1 at zero to infinity at pi/2 :
1/cos(clock*pi/2)

Just add 1 to the value returned by the tangent :
tan(clock*pi/2)+1


Post a reply to this message

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