Overview
∇φ is perpendicular to level sets of the form φ(r) = c.
Given a point r0 on the level set, set the normal vector
N to be some multiple of the gradient:
N = k ∇φ(r0)
Given a generic point r on the tangent, we see that:
N • (r-r0) = 0
⇒ N • r = N • r0
Thus we have an equation for the tangent line or plane!
In 2d: N1 x + N2 y = N1 x0 + N2 y0
In 3d:
N1 x + N2 y + N3 z = N1 x0 + N2 y0 + N3 z0