Scalar Field > Gradient Formula?

Feel free to ask any question here
Post Reply
mnotarian
Posts: 4
Joined: Thu Feb 09, 2023 6:57 pm

Scalar Field > Gradient Formula?

Post by mnotarian »

I was wondering if you could explain how scalar field gradients are calculated. I understand that they are a ratio of the change in the scalar field across a certain distance, but can you provide any more detailed information? Is it an average of change between the point and its nearest neighbors? Do you have the exact equation that is used?

Thanks very much in advance!
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar Field > Gradient Formula?

Post by daniel »

If you can read French you can refer to my PhD manuscript (https://theses.hal.science/pastel-00001745/)

Here is the formula:
gradient.JPG
gradient.JPG (10.07 KiB) Viewed 12311 times
P is the center point on which we compute the gradient, Pi is the ith neighbor. And f(P) is the scalar field value associated to the point P.
Daniel, CloudCompare admin
mnotarian
Posts: 4
Joined: Thu Feb 09, 2023 6:57 pm

Re: Scalar Field > Gradient Formula?

Post by mnotarian »

Thank you very much Daniel for your response and the formula. I can read French well enough, but unfortunately it is my lack of formal training in mathematical notation that is the problem. Would you mind explaining in layman's terms what the gradient formula is doing here? I really appreciate your help!
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar Field > Gradient Formula?

Post by daniel »

The gradient represents how much the scalar field changes, and the 'main' direction of change.

So we sum all the unit vectors that point from the central point to each of its neighbors. Each unit vector is multiplied by the difference of the scalar values (between the central point and its neighbor). And finally we divide the result by the number of neighbors.

In CC we just keep the amplitude/norm of the resulting vector (not the vector itself).
Daniel, CloudCompare admin
Post Reply