Total gradient of height field f(x,y,z)=0

158 Views Asked by At

I have a function given by

$$f(x,y,z) = 0$$

I sample this function in a tangent plane around a given point $A = (x,y,z)$. I create N points $A_i$ within a disc neighborhood of a point $A$ in its tangent plane, then I move those points by binary partitioning to the "surface" (to satisfy the above equation) and I calculate gradient $$\nabla A_{disc} =\sum_{i=0}^N \nabla f(A_i)$$

This solution is working quite OK and result is what I need. However, it is not quite elegnat and sometimes slow due to binary partitioning to find point on the surface.

Now I would like to know if it is possible (and if so, how) to compute this analytically without the need of sampling the function within the disc (or in other words, do the sampling for $N \rightarrow\infty $)