CoursElectriciteMagnetisme/Gnuplot/vector.UndipoleAddPlus.gnu

30 lines
913 B
Plaintext
Raw Normal View History

2024-02-03 20:45:14 +01:00
set xrange [-6:6]
set yrange [-6:6]
set iso 30 # taille de la grille de points
#set samp 37 # nombre de points utilisés
set samples 40 # nombre de points utilisés
set clip one
set zeroaxis
unset key
a = .0001
k = 9e9
# La charge positive
Q = 1e-6
xpos = -3
set object 1 circle front at xpos,0 size 0.1 fillcolor rgb "black" lw 1
set arrow from xpos-.06,0 to xpos+.06,0 nohead front
set arrow from xpos,-0.07 to xpos,0.07 nohead front
#set arrow from -1,-6 to -1,6 ls 4 nohead
# La charge négative
q = -1e-6
xneg = 3
set object 2 circle front at xneg,0 size 0.1 fillcolor rgb "black" lw 1
set arrow from xneg-.06,0 to xneg+.06,0 nohead front
#set arrow from 1,-6 to 1,6 nohead
# Le graphe
plot '++' using 1:2:\
(a*k*Q*($1-xpos)/(($1-xpos)**2+$2**2)**1.5+a*k*q*($1-xneg)/(($1-xneg)**2+$2**2)**1.5):\
(a*k*Q*$2/(($1-xpos)**2+$2**2)**1.5+a*k*q*$2/(($1-xneg)**2+$2**2)**1.5)\
w vect size .06, 15 filled
pause -1