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() :)
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
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
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
So we get: fClock=((pi/2)-atan(x))*clock+atan(x)
and then tan(fClock) should give you the desired result.
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