Gradient vector field Custom tool

Tool script
f(x, y) = x^2 - y^2[br][br]#------------------------------------[br]# Some interesting examples:[br]#------------------------------------[br]# -(sqrt(x² + y²) + 1 / sqrt(x² + y²)) cos(atan2(y,x))[br]# ln(sqrt((x + 1)² + y²)) - ln(sqrt((x - 1)² + y²))[br]# 1/sqrt(x^2+y^2)[br]# sqrt(x^2+y^2)[br]# arctan2(y,x)[br][br]fx(x, y) = Derivative(f, x)[br]fy(x, y) = Derivative(f, y)[br][br]scale = 0.15 [br]density = 10[br]xstep = (x(Corner(3)) - x(Corner(1))) / (density + 1)[br]ystep = (y(Corner(3)) - y(Corner(1))) / (density + 1)[br][br]Lx = Sequence(k, k, x(Corner(1)), x(Corner(3)), xstep)[br]Ly = Sequence(k, k, y(Corner(1)), y(Corner(3)), ystep)[br][br]vectorField = Zip(Zip(Vector((j, k), (j + scale fx(j, k), k + scale fy(j, k))), j, Lx), k, Ly)

Information: Gradient vector field Custom tool