POV-Ray : Newsgroups : povray.general : Decaying ripples Server Time
1 Nov 2024 15:24:42 EDT (-0400)
  Decaying ripples (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Stephen
Subject: Decaying ripples
Date: 22 Apr 2012 19:16:12
Message: <4f94913c@news.povray.org>
I am looking for a function to use in an isosurface that will give me 
ripples that will decay to zero over a short distance.
Can anyone suggest one?

TIA

-- 
Regards
     Stephen


Post a reply to this message

From: Bill Pragnell
Subject: Re: Decaying ripples
Date: 23 Apr 2012 03:20:08
Message: <web.4f9502776845f1165b7d07940@news.povray.org>
Stephen <mcavoys_at@aoldotcom> wrote:
> I am looking for a function to use in an isosurface that will give me
> ripples that will decay to zero over a short distance.
> Can anyone suggest one?

How about something like:

sin(a*x)*exp(-b*x^2)

Plot it, e.g., here for a quick preview:
http://rechneronline.de/function-graphs/

For more ripples over a given range, increase a
For a greater range, decrease b

Bill


Post a reply to this message

From: Stephen
Subject: Re: Decaying ripples
Date: 23 Apr 2012 05:07:58
Message: <4f951bee@news.povray.org>
On 23/04/2012 8:19 AM, Bill Pragnell wrote:
> Stephen<mcavoys_at@aoldotcom>  wrote:
>> I am looking for a function to use in an isosurface that will give me
>> ripples that will decay to zero over a short distance.
>> Can anyone suggest one?
>
> How about something like:
>
> sin(a*x)*exp(-b*x^2)
>
> Plot it, e.g., here for a quick preview:
> http://rechneronline.de/function-graphs/
>
> For more ripples over a given range, increase a
> For a greater range, decrease b
>
> Bill
>
>
  Ah! The exponential, just what I was looking for.
It is true that if you don't use it, you lose it.

Thanks Bill

-- 
Regards
     Stephen


Post a reply to this message

From: Bill Pragnell
Subject: Re: Decaying ripples
Date: 23 Apr 2012 06:40:01
Message: <web.4f95314e6845f1165b7d07940@news.povray.org>
Stephen <mcavoys_at@aoldotcom> wrote:
> On 23/04/2012 8:19 AM, Bill Pragnell wrote:
> > Stephen<mcavoys_at@aoldotcom>  wrote:
> >> I am looking for a function to use in an isosurface that will give me
> >> ripples that will decay to zero over a short distance.
> >> Can anyone suggest one?
> >
> > How about something like:
> >
> > sin(a*x)*exp(-b*x^2)
> >
> > Plot it, e.g., here for a quick preview:
> > http://rechneronline.de/function-graphs/
> >
> > For more ripples over a given range, increase a
> > For a greater range, decrease b
> >
> > Bill
> >
> >
>   Ah! The exponential, just what I was looking for.
> It is true that if you don't use it, you lose it.

Too true. I use it a little too much to be honest :)


Post a reply to this message

From: Stephen
Subject: Re: Decaying ripples
Date: 23 Apr 2012 10:09:05
Message: <4f956281$1@news.povray.org>
On 23/04/2012 11:39 AM, Bill Pragnell wrote:
>>    Ah! The exponential, just what I was looking for.
>> >  It is true that if you don't use it, you lose it.
> Too true. I use it a little too much to be honest:)
>
>
>
In that case you could use your mathematical brain ;-) to tell me how to 
translate the function below along the z axis. I used the formula that 
you suggestion to create a ripple but for the life of me I cannot move 
it from the origin.  After reading the doc I substituted z-2 for z and 
that did not work properly. I am at a loss.


(sqrt(exp(-0.5*x*x) *exp(-0.5*z*z) ))  }


-- 
Regards
     Stephen


Post a reply to this message

From: clipka
Subject: Re: Decaying ripples
Date: 23 Apr 2012 10:30:22
Message: <4f95677e$1@news.povray.org>
Am 23.04.2012 16:09, schrieb Stephen:
> On 23/04/2012 11:39 AM, Bill Pragnell wrote:
>>> Ah! The exponential, just what I was looking for.
>>> > It is true that if you don't use it, you lose it.
>> Too true. I use it a little too much to be honest:)
>>
>>
>>
> In that case you could use your mathematical brain ;-) to tell me how to
> translate the function below along the z axis. I used the formula that
> you suggestion to create a ripple but for the life of me I cannot move
> it from the origin. After reading the doc I substituted z-2 for z and
> that did not work properly. I am at a loss.
>

> *exp(-0.5*z*z) )) }

Should have worked, maybe you missed a z somewhere.

The more robust approach is to leave your function as-is, and call it 
from another function such as:

function { foo(x,y,z-2) }


Post a reply to this message

From: Stephen
Subject: Re: Decaying ripples
Date: 23 Apr 2012 10:40:37
Message: <4f9569e5$1@news.povray.org>
On 23/04/2012 3:30 PM, clipka wrote:
> Am 23.04.2012 16:09, schrieb Stephen:


>> *exp(-0.5*z*z) )) }
>
> Should have worked, maybe you missed a z somewhere.
>

I had so many Zeds in it that I almost fell asleep. :-)

> The more robust approach is to leave your function as-is, and call it
> from another function such as:
>
> function { foo(x,y,z-2) }

That makes sense and it's a good idea.
Thanks

-- 
Regards
     Stephen


Post a reply to this message

From: Bill Pragnell
Subject: Re: Decaying ripples
Date: 23 Apr 2012 11:00:01
Message: <web.4f956dd96845f1165b7d07940@news.povray.org>
Stephen <mcavoys_at@aoldotcom> wrote:
> On 23/04/2012 3:30 PM, clipka wrote:
> > Am 23.04.2012 16:09, schrieb Stephen:
>

> >> *exp(-0.5*z*z) )) }
> >
> > Should have worked, maybe you missed a z somewhere.
> >
>
> I had so many Zeds in it that I almost fell asleep. :-)
>
> > The more robust approach is to leave your function as-is, and call it
> > from another function such as:
> >
> > function { foo(x,y,z-2) }
>
> That makes sense and it's a good idea.

Just what I was going to suggest. Mike Williams' isosurface page has lots of
useful tips, eg:
http://www.econym.demon.co.uk/isotut/substitute.htm

Bill


Post a reply to this message

From: Stephen
Subject: Re: Decaying ripples
Date: 23 Apr 2012 11:21:04
Message: <4f957360$1@news.povray.org>
On 23/04/2012 3:57 PM, Bill Pragnell wrote:
> Just what I was going to suggest. Mike Williams' isosurface page has lots of
> useful tips, eg:
> http://www.econym.demon.co.uk/isotut/substitute.htm

I have been reading it but I missed that. :-(
For someone who just hacks code (in the original sense), it did not twig.

-- 
Regards
     Stephen


Post a reply to this message

From: Stephen
Subject: Re: Decaying ripples
Date: 23 Apr 2012 16:22:05
Message: <4f95b9ed@news.povray.org>
On 23/04/2012 12:16 AM, Stephen wrote:

Thanks to both of you. I got what I was aiming for.


-- 
Regards
     Stephen


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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