In level set a distance function is defined as:
$$ d(\vec{x})=\min(\left|\vec{x}-\vec{x}_{I}\right|) $$ where $\vec{x}_{I}$is a point on the interface, for two spatial dimensions it can be a curve.
Furthermore, since $d$ is Euclidean distance, then:
$$\left|\nabla d\right|=1$$
I know how to envaluate a gradient of a explicit function like $f(x,y)=x^2+y^2$, but this distance function behaves quite strange offering no access to caculate.
What have I done is below, maybe I need some more knowledge and your help:
$$ \left|\nabla d\right| = \sqrt{\left(\frac{\partial d}{\partial x}\right)^2+\left(\frac{\partial d}{\partial y}\right)^2} $$