Hi. I have the following function I what to make a vector plot of:
I have:
using Plots
using LinearAlgebra
L=0.1
s=[0 -L/2]
e=[0 L/2]
l=e-s
function GDA(x,y)
if 0==x && 0==y
return 0.0
end
ra=[x y]-s
rb=[x y]-e
da=sqrt(dot(ra,ra))
db=sqrt(dot(rb,rb))
res=-l*(1.0/da+1.0/db)
res+=rb*dot(l,rb)/db^3
res+=ra*dot(l,ra)/da^3
t=ra/da+rb/db
res+=t
res+=t*dot(l,t)*(1.0/(da+db+L)+1.0/(da+db-L))
res*=2.0/((da+db)*(da+db)-L*L)
return res
end
xs = -2:0.2:2
ys = -2:0.2:2
xxs = [x for x in xs for y in ys]
yys = [y for x in xs for y in ys]
field = [GDA(x,y) for x in xs for y in ys]
quiver(xxs, yys, quiver=(field[1,:],field[2,:]))
Quiver don’t like the format, but how do I generate a format quiver like ?