POV-Ray : Newsgroups : povray.general : Bell curves Server Time
30 Jul 2024 12:27:39 EDT (-0400)
  Bell curves (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: SharkD
Subject: Bell curves
Date: 31 Aug 2009 17:22:38
Message: <4a9c3f1e$1@news.povray.org>
I would like to create a function for a heightfield that has a nice bell 
curve shape, but can also be normalized between 0 and 1 along each axis. 
I've looked at the normal distribution and beta distribution functions, 
but they can only be normalized along one axis.

The sine wave can be normalized, but it is not "fat" enough (i.e. I 
would like the peak to be wider than the trough). What other options are 
there?

-Mike


Post a reply to this message

From: Francois LE COAT
Subject: Re: Bell curves
Date: 31 Aug 2009 17:59:55
Message: <4a9c47db$1@news.povray.org>
Hi,

SharkD writes :
> I would like to create a function for a heightfield that has a nice bel
l 
> curve shape, but can also be normalized between 0 and 1 along each axis
. 
> I've looked at the normal distribution and beta distribution functions,
 
> but they can only be normalized along one axis.
> 
> The sine wave can be normalized, but it is not "fat" enough (i.e. I 
> would like the peak to be wider than the trough). What other options ar
e 
> there?

t in [0,2*Pi], y in ]-1,1[ then bell curve is

	"cos^2(t)+sin^2(t)=(4+ath(-y))^2"

ath() is hyperbolic arctangent means inverse of hyperbolic tangent th().

Does it suits you ?

Regards,

-- 

Author of Eureka 2.12 (2D Graph Describer, 3D Modeller)
http://eureka.atari.org/
http://fon.gs/eureka/


Post a reply to this message

From: SharkD
Subject: Re: Bell curves
Date: 31 Aug 2009 19:05:42
Message: <4a9c5746$1@news.povray.org>
Francois LE COAT wrote:
> t in [0,2*Pi], y in ]-1,1[ then bell curve is
> 
>     "cos^2(t)+sin^2(t)=(4+ath(-y))^2"
> 
> ath() is hyperbolic arctangent means inverse of hyperbolic tangent th().
> 
> Does it suits you ?
> 
> Regards,
> 

Is this a correct transformation?

0 = tanh(sqrt(cos(t)^2 + sin(t)^2) - 4) + y


Post a reply to this message

From: SharkD
Subject: Re: Bell curves
Date: 31 Aug 2009 19:08:23
Message: <4a9c57e7$1@news.povray.org>
SharkD wrote:
> I've looked at the normal distribution and beta distribution functions, 
> but they can only be normalized along one axis.

I figured out how to normalize the beta distribution, but the formula 
involves and integral and I don't know how to do that in POV.

-Mike


Post a reply to this message

From: triple r
Subject: Re: Bell curves
Date: 31 Aug 2009 21:55:01
Message: <web.4a9c7e1a687fa7e9958421d50@news.povray.org>
SharkD <mik### [at] gmailcom> wrote:
> I would like to create a function for a heightfield that has a nice bell
> curve shape, but can also be normalized between 0 and 1 along each axis.
> I've looked at the normal distribution and beta distribution functions,
> but they can only be normalized along one axis.

I don't know quite what you mean by normalizing a two-dimensional function along
one axis.  You can normalize the maximum of the function to 1.  You can
normalize the volume under the whole surface to one.  You can also normalize
the area under a cross-section, but which quantity do you want to normalize
along different axes?  What part of

exp(-((x/sigma_x)^2 + (y/sigma_y)^2) / 2)

makes it unsuitable for the purpose?  Please don't interpret the question
negatively; I just really don't understand the question.

 - Ricky


Post a reply to this message

From: Francois LE COAT
Subject: Re: Bell curves
Date: 1 Sep 2009 07:27:48
Message: <4a9d0534$1@news.povray.org>
Hi,

SharkD writes :
> Francois LE COAT writes :
>> t in [0,2*Pi], y in ]-1,1[ then bell curve is
>>
>>     "cos^2(t)+sin^2(t)=(4+ath(-y))^2"
>>
>> ath() is hyperbolic arctangent means inverse of hyperbolic tangent th(
).
>>
>> Does it suits you ?
> 
> Is this a correct transformation?
> 
> 0 = tanh(sqrt(cos(t)^2 + sin(t)^2) - 4) + y

y = th( 4 - sqrt(x^2 + z^2) ) with x in [-8,8] and z in [-8,8]

That's correct, it looks like :-)

Regards,

-- 

Author of Eureka 2.12 (2D Graph Describer, 3D Modeller)
http://eureka.atari.org/
http://fon.gs/eureka/


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: Bell curves
Date: 1 Sep 2009 14:11:31
Message: <4a9d63d3@news.povray.org>
Francois LE COAT wrote:
> Hi,
> 
> SharkD writes :
>> I would like to create a function for a heightfield that has a nice 
>> bell curve shape, but can also be normalized between 0 and 1 along 
>> each axis. I've looked at the normal distribution and beta 
>> distribution functions, but they can only be normalized along one axis
.
>>
>> The sine wave can be normalized, but it is not "fat" enough (i.e. I 
>> would like the peak to be wider than the trough). What other options 
>> are there?
> 
> t in [0,2*Pi], y in ]-1,1[ then bell curve is
> 
>     "cos^2(t)+sin^2(t)=(4+ath(-y))^2"
> 
	You do know that "cos^2(t)+sin^2(t)" is 1 for all t do you?

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: Francois LE COAT
Subject: Re: Bell curves
Date: 1 Sep 2009 14:29:11
Message: <4a9d67f7$1@news.povray.org>
Hi,


> You do know that "cos^2(t)+sin^2(t)" is 1 for all t do you?

Please read the following reply. It's a mistake. You should
replace the formula with "x^2+y^2" like in the final equation.

The bell curve surface y=f(x,z) is described correctly.

Thanks,

-- 

Author of Eureka 2.12 (2D Graph Describer, 3D Modeller)
http://eureka.atari.org/
http://fon.gs/eureka/


Post a reply to this message

From: triple r
Subject: Re: Bell curves
Date: 1 Sep 2009 14:55:00
Message: <web.4a9d6d9b687fa7e9958421d50@news.povray.org>
SharkD <mik### [at] gmailcom> wrote:
> I would like to create a function for a heightfield that has a nice bell
> curve shape, but can also be normalized between 0 and 1 along each axis.
> I've looked at the normal distribution and beta distribution functions,
> but they can only be normalized along one axis.

Oh.  It took me a bit to realize what you meant, but why not just

exp(-x*x-y*y) * (x-1) * (x+1) * (y-1) * (y+1)

This just clamps the edges to zero while keeping the center at 1.  Still 'looks'
gaussian.

 - Ricky


Post a reply to this message

From: SharkD
Subject: Re: Bell curves
Date: 1 Sep 2009 18:29:46
Message: <4a9da05a@news.povray.org>
triple_r wrote:
> SharkD <mik### [at] gmailcom> wrote:
>> I would like to create a function for a heightfield that has a nice bell
>> curve shape, but can also be normalized between 0 and 1 along each axis.
>> I've looked at the normal distribution and beta distribution functions,
>> but they can only be normalized along one axis.
> 
> Oh.  It took me a bit to realize what you meant, but why not just
> 
> exp(-x*x-y*y) * (x-1) * (x+1) * (y-1) * (y+1)
> 
> This just clamps the edges to zero while keeping the center at 1.  Still 'looks'
> gaussian.
> 
>  - Ricky
> 
> 
> 

I ended up using this function:

#local BetaA = 3;
#local BetaB = 3;
#local ThingX = ((BetaA - 1) / (BetaB - 1 + BetaA - 1) - 1/2) * 2;
#local ThingY = pow(ThingX/2 + 1/2, BetaA - 1) * pow(1 - (ThingX/2 + 
1/2), BetaB - 1);

function {pow(f_r(x,y,z)/2 + 1/2, BetaA - 1) * pow(1 - (f_r(x,y,z)/2 + 
1/2), BetaB - 1) / ThingY}

It's basically the same as the beta distribution function, minus the 
exponent (or beta function). I realized it was not necessary.

-Mike


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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