Fichier viviani.jps — Modifié le 12 Février 2008 à 15 h 11

viviani.pdf
Source
%% d'apres les donnees de
%% http://www.mathcurve.com/courbes3d/viviani/viviani.shtml

-2 2 setxrange
-2 2 setyrange
150 setxunit

10 10 6 SetCamPos
0 0 0 SetCamView

-10 10 setxrange3d
-3 3 setyrange3d
2 setlinejoin
rouge

/g {
3 dict begin
   settvar
#rpn# (Cos (t))^2
#rpn# Cos (t)* Sin (t)
#rpn# Sin (t)
end
} def

/g' {
3 dict begin
   settvar
#rpn# -2 * Sin (t) * Cos (t)
#rpn# - Sin (t)* Sin (t) + Cos (t)* Cos (t)
#rpn# Cos (t)
end
} def

/g'' {
3 dict begin
   settvar
#rpn# -2*Cos(t)*Cos(t) + 2*Sin(t)*Sin(t)
#rpn# -2*Cos(t)*Sin(t) -2*Sin(t)*Cos(t)
#rpn# -Sin(t)
end
} def


 0 pi 2 mul {g} CourbeR3
% stop

.3 setlinewidth
%/aretescachees false def
noir

%GetCamPos setlightsrc
%solidgridOff

/defaultsolidmode 3 def
1 [36 36] newsphere
dup (0 setfillopacity blanc) outputcolors
dup videsolid

-1 .5 1 [18 36] newcylindre
{.5 0 0 translatepoint3d} solidtransform
dup (0 setfillopacity blanc) outputcolors
dup videsolid
solidfuz

0 pi (g) .05 [21 6] newtube
pi neg 0 (g) .05 [21 6] newtube
solidfuz
dup (rouge) outputcolors
solidfuz
drawsolid**