If you are standing on the side of a mountain at a point (x,y) and you know where the peak is (Xp, Yp) and how high it is (Zp) and you have a function G(x,y) that defines the 3D normal vector to the mountain side at all points on the surface, how do you calculate your height?
OK it's a simple...