POV-Ray : Newsgroups : povray.advanced-users : Exponential cylinder density function : Re: Exponential cylinder density function Server Time 3 Mar 2024 11:55:05 EST (-0500)
 Re: Exponential cylinder density function
 From: Alain Martel 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))}
```