POV-Ray : Newsgroups : povray.advanced-users : [Math] Function gradients and gradient normalized functions Server Time 4 Dec 2023 05:24:18 EST (-0500)
 [Math] Function gradients and gradient normalized functions (Message 1 to 2 of 2)
 From: Bald Eagle Subject: [Math] Function gradients and gradient normalized functions Date: 18 May 2020 19:10:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"dateCreated": "2020-05-18T23:10:00+00:00",
"datePublished": "2020-05-18T23:10:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
I'm trying to apply a bit of rigor to the math - and POV-Ray's functions.

Function (x, y, z) = a scalar value

But the gradient of a function is a VECTOR, in the direction of the greatest
increase of the function.  In 2D, the shortest distance to the next level curve,
and in 3D, the shortest distance to the next level set.

but
fn_Gradient (Function), being a POV-Ray function returns a scalar value...

So...

I'm guessing that in order to do something like plot a gradient field, I need to
do something like evaluate the ... directional gradient (?) separately for x, y,
and z in order to get a vector for the actual gradient?

Then if I wanted to show the gradient of a curve, I'd plot point P as a sphere,
and then draw a cylinder from P to P * S(scalar)?

And the normal is a vector perpendicular to the gradient - the dot product of
the [normalized?] gradient vector and the directional derivative.

Do I have this all correct?
```
 From: Bald Eagle Subject: Re: [Math] Function gradients and gradient normalized functions Date: 18 May 2020 22:00:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5ec33c80cab151a1fb0b41570%40news.povray.org",
"dateCreated": "2020-05-19T02:00:01+00:00",
"datePublished": "2020-05-19T02:00:01+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
"Bald Eagle" <cre### [at] netscapenet> wrote:

Hang on - slight confusion:

> I'm guessing that in order to do something like plot a gradient field, I need to
> do something like evaluate the ...

partial derivatives of W = F(x,y,z)

> separately for x, y,
> and z in order to get a vector for the actual gradient?
>
> Then if I wanted to show the gradient of a curve, I'd

draw a cylinder from the origin to Gradient * S(scalar) and translate to P

> And the normal