Ask Your Question

Revision history [back]

Yes, you can limit the proximity to the pole:

my_grad = [lambda x,y: grad[0].subs(x=x,y=y) if x^2 + y^2 > 0.1 else None,
           lambda x,y: grad[1].subs(x=x,y=y) if x^2 + y^2 > 0.1 else None]
plot_vector_field(my_grad, (x,-1,1), (y,-1,1)).show()

limit proximity to pole

or limit the length of the vectors:

grad_len = abs(grad)
my_grad = [lambda x,y: grad[0].subs(x=x,y=y) if grad_len.subs(x=x,y=y) < 7 else None,
           lambda x,y: grad[1].subs(x=x,y=y) if grad_len.subs(x=x,y=y) < 7 else None]
plot_vector_field(my_grad, (x,-1,1), (y,-1,1)).show()

limit vector length

Yes, you can limit the proximity to the pole:

my_grad = [lambda x,y: grad[0].subs(x=x,y=y) if x^2 + y^2 > 0.1 else None,
           lambda x,y: grad[1].subs(x=x,y=y) if x^2 + y^2 > 0.1 else None]
plot_vector_field(my_grad, (x,-1,1), (y,-1,1)).show()

limit proximity to pole

or limit the length of the vectors:

grad_len = abs(grad)
my_grad = [lambda x,y: grad[0].subs(x=x,y=y) if grad_len.subs(x=x,y=y) abs(grad.subs(x=x,y=y)) < 7 else None,
           lambda x,y: grad[1].subs(x=x,y=y) if grad_len.subs(x=x,y=y) abs(grad.subs(x=x,y=y)) < 7 else None]
plot_vector_field(my_grad, (x,-1,1), (y,-1,1)).show()

limit vector length