- #1
johnnyk427
- 2
- 0
Simple gradient question.. I have a kernel function that determines the influence of each water droplet given a radius r:
(10/pi*h^5)*(h-r)^3
The gradient of that is:
(-30/pi*h^5)*(h-r)^2
But 'r' is not a vector, its a scalar, its just the distance to the point in question. So how do I get a gradient vector out of that equation? Maybe I want to replace 'r' with the x distance and use that to determine the 'x' component of the gradient, and same for 'y'? But that doesn't seem right..
(yes, i know this is a newb question, thanks for any help! It's not homework just a project I'm working on for fun.)
-John
(10/pi*h^5)*(h-r)^3
The gradient of that is:
(-30/pi*h^5)*(h-r)^2
But 'r' is not a vector, its a scalar, its just the distance to the point in question. So how do I get a gradient vector out of that equation? Maybe I want to replace 'r' with the x distance and use that to determine the 'x' component of the gradient, and same for 'y'? But that doesn't seem right..
(yes, i know this is a newb question, thanks for any help! It's not homework just a project I'm working on for fun.)
-John