Advertisement

What is the gradient symbol for

Started by January 12, 2015 07:45 PM
16 comments, last by jmakitalo 10 years, 1 month ago
Where did the extra factor of `rlen' come from?

Where did the extra factor of `rlen' come from?

Its the distance vector between two particle positions and rlen is the magnitude of this vector.

Advertisement

Where did the extra factor of `rlen' come from?


Its the distance vector between two particle positions and rlen is the magnitude of this vector.


What I mean is that
final float term = 45.0f / ((float)Math.PI * (float)Math.pow(kH, 6) * rlen);
should probably be
final float term = 45.0f / ((float)Math.PI * (float)Math.pow(kH, 6));
Unless you can explain where "the extra factor of rlen" came from.

Where did the extra factor of `rlen' come from?


Its the distance vector between two particle positions and rlen is the magnitude of this vector.


What I mean is that

final float term = 45.0f / ((float)Math.PI * (float)Math.pow(kH, 6) * rlen);
should probably be

final float term = 45.0f / ((float)Math.PI * (float)Math.pow(kH, 6));
Unless you can explain where "the extra factor of rlen" came from.

Observe the different symbols in his equations: the argument to the function is r (bold and upface) which is presumably a vector, whereas the equations contain r (normal weight and slanted) that is used in a scalar context. His code maps to his equation under the assumption that r=|r|.

Never mind. The code does seem correct. Using variations of the letter r to mean different things was too subtle for me. smile.png

Never mind. The code does seem correct. Using variations of the letter r to mean different things was too subtle for me. smile.png

That was something which had confused me too, the bold r and the normal r but now i now what they mean :)

Advertisement

I think the vector r in your gradient equation needs to be normalized

I think the vector r in your gradient equation needs to be normalized

It is normalized by the r in the denominator. In the given formula, the unit vector is given explicitly in the form r/r.

This topic is closed to new replies.

Advertisement