/interdroiteell {
12 dict begin
aload pop
/alpha exch def
/b exch def
/a exch def
/I defpoint
%% on se ramene a une ellipse de centre (0, 0), d'angle 0
I -1 mulv translatedroite
0 0 alpha neg rotatedroite
/d defdroite
d verticale? {
d
popp
pop
/X0 exch def
%% 2 2 2
%% RootOf(_Z + x0 - a ) b
%% rep := {y = ------------------------, x = x0}
%% a
a dup mul X0 dup mul sub sqrt
b a div mul
/Y0 exch def
X0 Y0 X0 Y0 neg
}
{
/a1 d coeffdir def
/b1 d ordorig def
%% 2 2 2 2 2 2
%% {y = a1 RootOf((b + a a1 ) _Z + b1 - b + 2 b1 a1 a _Z) a + b1,
%%
%% 2 2 2 2 2 2
%% x = RootOf((b + a a1 ) _Z + b1 - b + 2 b1 a1 a _Z) a}
%% on prepare l'equation du 2nd degre
%% coeff pour le degre 2
b dup mul
a dup mul a1 dup mul mul add
%% coeff pour le degre 1
2 b1 mul a1 mul a mul
%% coeff pour le degre 0
b1 dup mul
b dup mul sub
solve2nddegre
a mul /X0 exch def
a mul /X1 exch def
X0 dup a1 mul b1 add
X1 dup a1 mul b1 add
} ifelse
0 0 alpha rotatedroite
I translatedroite
end
} def
|