-2 7 setxrange
-3 7 setyrange
/L1 .7 def
/l1 4 def
/L2 8 def
/l2 .5 def
/L3 1 def
/l3 .7 def
/L4 3 def
/l4 .7 def
/dt .1 def
%% ========
/A2 {0 2} def
/A1 {l2 2 div l1 2 div add 0} def
/A3 {A1 .8 mulv 0 L1 2 div L3 2 div add dt add addv} def
/A'3 {A3 projx 0 L1 2 div L3 2 div add dt add neg addv} def
/A4 {l1 l4 2 div add l2 2 div add 0} def
/A5 {l1 l2 2 div add L4 2 div .8 mul} def
/A {l2 2 div 0} def
/B {A3 projx l3 -2 div 0 addv} def
%% syntaxe : A Lx Ly rect@ngle
/rect@ngle {
2 dict begin
/Ly exch 2 div def
/Lx exch 2 div def
stranslate
newpath
Lx Ly smoveto
0 Ly -2 mul srlineto
Lx -2 mul 0 srlineto
0 Ly 2 mul srlineto
closepath
end
} def
%% syntaxe : A Lx Ly rectangle
/rectangle {
2 dict begin
gsave
rect@ngle
stroke
grestore
end
} def
%% syntaxe : A Lx Ly rectangle*
/rectangle* {
4 copy
rectangle
2 dict begin
gsave
rect@ngle
clip
fillstyle
grestore
end
} def
%% ==============
/fillstyle {.3 setlinewidth hachure} def
%% .2 .2 setquadrillagestep
%% quadrillage
%%
%% gsave
%% 1 dict begin
%% 1 1 setquadrillagestep
%% /quadrillagegray 0 def
%% quadrillage
%% end
%% grestore
%%
%% marks
%% [A1 A2 A3 A'3 A4 A5 A B] points
gsave
mixte
traceaxes
grestore
.8 setlinewidth
A1 l1 L1 rectangle
A2 l2 L2 rectangle
A3 l3 L3 rectangle*
A'3 l3 L3 rectangle*
A4 l4 L4 rectangle
A B .7 5 (O) ressort
/ell {
A2 0 L2 2 div translatepoint
l2 .25
} def
-225 45
ell Ellipse
gsave
50 [ell 0] epoint stranslate
.4 .4 scale
[ell 0] ellb 2 sqrt mul
[ell 0] ella neg 2 sqrt mul
atan 10 sub rotate
arrow
grestore
gsave
newpath
A5 smoveto
A5 .17 90 270 sarc
clip
fill
grestore
|