Source
%% auteur : Gilles Mora

400 setwidth
1 1 scale
90 setangle_repere
1 setxyrapport
-3 9 setxrange
-2 9 setyrange

-6 25 setxrange
-5 8 setyrange
%quadrillage

/A {2 1} def
/B {7 4} def
2 setlinewidth
A B droite
1 setlinewidth

/C{7 1} def
B dashpoint
A dashpoint
tracerepere

pointilles
[A C] ligne
[B C] ligne
A C B angledroit

setTimes
(A) A [1.5 1.5] ultext
(B) B [1.5 1.5] drtext
<tex>
$\vec \imath $
</tex>
.3 0 [1.5 dup] dctexlabel
<tex>
$\vec \jmath $
</tex>
0 .1 [1.5 dup] ultexlabel



<tex>
$x_B-x_A$
</tex>
A C milieu [1.5 dup] dctexlabel
<tex>
$y_B-y_A$
</tex>
B C milieu [1.5 dup] drtexlabel


<tex>
$x_A$
</tex>
2 0 [1.5 dup] dctexlabel
<tex>
$x_B$
</tex>
7 0 [1.5 dup] dctexlabel


<tex>
$y_A$
</tex>
0 1 [1.5 dup] cltexlabel
<tex>
$y_B$
</tex>
0 4 [1.5 dup] cltexlabel


continu
<latex>
$a=\displaystyle{\frac{y_B-y_A}{x_B-x_A}}$
</latex>
boxit
4 8 [2 dup] dctexlabel



<tex>
$y=ax+b$
</tex>
-2 -1.5 {A B angle}  uctexlabel