%% syntaxe : A B droite
/droite {
gsave
6 dict begin
/yB exch def
/xB exch def
/yA exch def
/xA exch def
xA yA xB yB
eqp
{}
{
xA yA xB yB
verticale?
{
newpath
xA ymin smoveto
xA ymax slineto
stockcurrentcpath
stroke
}
{
newpath
/alpha xA yA xB yB coeffdir def
/beta xA yA xB yB ordorig def
xmin dup alpha mul beta add smoveto
xmax dup alpha mul beta add slineto
stockcurrentcpath
stroke
}
ifelse
}
ifelse
end
grestore
} def
|