# Calculation of a gradient (numerically)

I have looked through available answers, but they don't seem to answer my very basic question, and I don't know how to phrase it differently.

It's a basic question because essentially I know nothing about the del-operator or gradients :)

I'd like to know how to calculate the equation

$\vec f_{pressure} = \nabla W(\vec x - \vec x_i, h)$

where W is a function that was previously used without a gradient in front of it, and has returned a scalar value, so I'm assuming it still does.

Specifically, W looks like this:

$W(\vec r,h) = \frac{15}{\pi * h^6}$ when ||r||< h and 0 otherwise

Also, in the same manner, I would like to know how to calculate the result of

$\vec f_{pressure} = \nabla^2 W(\vec x - \vec x_i, h)$

-
 Note: In the real example, there are a couple of scalar factors in front of the function involved also, but I left them out for simplicity. – heishe Aug 8 '12 at 9:04