Ask Your Question

Revision history [back]

An alternative is to define f on the Euclidean plane minus a small disk around the origin:

E.<x,y> = EuclideanSpace()
U = E.open_subset('U', coord_def={E.cartesian_coordinates(): x^2+y^2>0.2})
f = U.scalar_field(1/sqrt(x^2+y^2))
grad = f.gradient()
grad.plot(max_range=1, scale=0.1)

gradient plot