POV-Ray : Newsgroups : povray.advanced-users : Exponential cylinder density function Server Time20 Apr 2024 09:58:37 EDT (-0400)
 Exponential cylinder density function (Message 1 to 8 of 8)
 From: Mike Horvath Subject: Exponential cylinder density function Date: 6 Feb 2021 23:48:34 Message: <601f7122\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#601f7122%241%40news.povray.org",
"dateCreated": "2021-02-07T04:48:34+00:00",
"datePublished": "2021-02-07T04:48:34+00:00",
"author": {
"@type": "Person",
"name": "Mike Horvath"
}
}
I am using this density function:

function {1-f_cylindrical(x,y,z)}

How do I make it so that the density decreases exponentially?

Simply this?

function {1-f_cylindrical(x,y,z)*f_cylindrical(x,y,z)}

Thanks.

Mike
```
 From: Mike Horvath Subject: Re: Exponential cylinder density function Date: 6 Feb 2021 23:49:50 Message: <601f716e\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#601f716e%241%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-07T04:49:50+00:00",
"datePublished": "2021-02-07T04:49:50+00:00",
"author": {
"@type": "Person",
"name": "Mike Horvath"
}
}
On 2/6/2021 11:48 PM, Mike Horvath wrote:
> I am using this density function:
>
> function {1-f_cylindrical(x,y,z)}
>
> How do I make it so that the density decreases exponentially?
>
> Simply this?
>
> function {1-f_cylindrical(x,y,z)*f_cylindrical(x,y,z)}
>
> Thanks.
>
>
> Mike

Increases rather.

Mike
```
 From: Bald Eagle Subject: Re: Exponential cylinder density function Date: 7 Feb 2021 09:10:09 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.601ff42ce7960e541f9dae300%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-07T14:10:09+00:00",
"datePublished": "2021-02-07T14:10:09+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
Mike Horvath <mik### [at] gmailcom> wrote:
> On 2/6/2021 11:48 PM, Mike Horvath wrote:
> > I am using this density function:
> >
> > function {1-f_cylindrical(x,y,z)}
> >
> > How do I make it so that the density decreases exponentially?
> Increases rather.

> > function {1-f_cylindrical(x,y,z)*f_cylindrical(x,y,z)}

This would be geometrically?

Exponentially would imply using log() or (exp) ?
or maybe pow (term, some varying power)

I usually use a spreadsheet, or plot my function in POV-Ray with spheres to show
myself what's actually going on
```
 From: Alain Martel Subject: Re: Exponential cylinder density function Date: 8 Feb 2021 10:24:57 Message: <602157c9\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#602157c9%241%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-08T15:24:57+00:00",
"datePublished": "2021-02-08T15:24:57+00:00",
"author": {
"@type": "Person",
"name": "Alain Martel"
}
}
Le 2021-02-07 à 09:07, Bald Eagle a écrit :
>
> Mike Horvath <mik### [at] gmailcom> wrote:
>> On 2/6/2021 11:48 PM, Mike Horvath wrote:
>>> I am using this density function:
>>>
>>> function {1-f_cylindrical(x,y,z)}
>>>
>>> How do I make it so that the density decreases exponentially?
>> Increases rather.
>
>
>>> function {1-f_cylindrical(x,y,z)*f_cylindrical(x,y,z)}
>
> This would be geometrically?
>
> Exponentially would imply using log() or (exp) ?
> or maybe pow (term, some varying power)
>
> I usually use a spreadsheet, or plot my function in POV-Ray with spheres to show
> myself what's actually going on
>
>

function {1-f_cylindrical(x,y,z)*f_cylindrical(x,y,z)}
is exactly the same as
function {1-pow(f_cylindrical(x,y,z),2)}

The advantage of the second is that f_cylindrical need to be evaluated
only once, making the evaluation of the whole function faster.

An exponential curve could be something like :
function {1- exp(f_cylindrical(x,y,z))}
```
 From: Mike Horvath Subject: Re: Exponential cylinder density function Date: 8 Feb 2021 16:22:25 Message: <6021ab91\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#6021ab91%241%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-08T21:22:25+00:00",
"datePublished": "2021-02-08T21:22:25+00:00",
"author": {
"@type": "Person",
"name": "Mike Horvath"
}
}
On 2/7/2021 9:07 AM, Bald Eagle wrote:
> This would be geometrically?
>

Dunno what you mean.

> Exponentially would imply using log() or (exp) ?
> or maybe pow (term, some varying power)
>
> I usually use a spreadsheet, or plot my function in POV-Ray with spheres to show
> myself what's actually going on
>
>

Which would be better for planet atmosphere density? I used `pow` but is
`exp` better?

Mike
```
 From: Mike Horvath Subject: Re: Exponential cylinder density function Date: 8 Feb 2021 16:24:04 Message: <6021abf4\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#6021abf4%241%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-08T21:24:04+00:00",
"datePublished": "2021-02-08T21:24:04+00:00",
"author": {
"@type": "Person",
"name": "Mike Horvath"
}
}
On 2/8/2021 10:24 AM, Alain Martel wrote:
> The advantage of the second is that f_cylindrical need to be evaluated
> only once, making the evaluation of the whole function faster.
>

Good tip, thanks! Any speed improvement is important.

Mike
```
 From: Bald Eagle Subject: Re: Exponential cylinder density function Date: 8 Feb 2021 18:55:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.6021ced0e7960e541f9dae300%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-08T23:55:01+00:00",
"datePublished": "2021-02-08T23:55:01+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
Mike Horvath <mik### [at] gmailcom> wrote:
> On 2/7/2021 9:07 AM, Bald Eagle wrote:
> > This would be geometrically?
> Dunno what you mean.

Doesn't matter - I think they're the same.

> Which would be better for planet atmosphere density? I used `pow` but is
> `exp` better?

https://en.wikipedia.org/wiki/Density_of_air#Variation_with_altitude
```
 From: Mike Horvath Subject: Re: Exponential cylinder density function Date: 22 Feb 2021 13:57:50 Message: <6033feae\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#6033feae%241%40news.povray.org",
"headline": "Re: Exponential cylinder density function",
"dateCreated": "2021-02-22T18:57:50+00:00",
"datePublished": "2021-02-22T18:57:50+00:00",
"author": {
"@type": "Person",
"name": "Mike Horvath"
}
}
On 2/8/2021 6:52 PM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> On 2/7/2021 9:07 AM, Bald Eagle wrote:
>>> This would be geometrically?
>> Dunno what you mean.
>
> Doesn't matter - I think they're the same.
>
>
>> Which would be better for planet atmosphere density? I used `pow` but is
>> `exp` better?
>
> https://en.wikipedia.org/wiki/Density_of_air#Variation_with_altitude
>
>
>
>

I'm not very good at math so I don't know how to translate that into
something POV-Ray can consume.

Mike
```