%% d'apres un code original de Maxime Chupin et Manuel Luque -2 2 setxrange -2 2 setyrange 100 setxunit 60 60 12 SetCamPos 0 0 0 SetCamView %/ScreenDist .075 def -10 10 setxrange3d -3 3 setyrange3d 2 setlinejoin .1 setlinewidth gris /g { 3 dict begin /t exch def #rpn# 0.5*Sin(0.707)*t*Cos(t) #rpn# 0.5*Sin(0.707)*t*Sin(t) #rpn# -0.5*t*Cos(0.707) end } def /g' { % derivee premiere 3 dict begin /t exch def 0.5 0.707 Sin mul t Cos t t Sin mul sub mul % 0.5*Sin(0.707)*(Cos(t)-t*Sin(t)) 0.5 0.707 Sin mul t Sin t t Cos mul add mul % 0.5*Sin(0.707)*(Sin(t)+t*Cos(t)) -0.5 0.707 Sin mul % -0.5*Sin(0.707) end } def /g'' { % derivee seconde 3 dict begin /t exch def -0.5 0.707 Sin mul t mul t Cos mul % -0.5*Sin(0.707)*t*Cos(t) 0.5 0.707 Sin mul t Cos 2 mul t t Sin mul sub mul % 0.5*Sin(0.707)*(2*Cos(t)-t*Sin(t)) 0 % 0 end } def % spirale % t_min t_max rayon_tube [resolution] -25.4 25.4 (g) .4 [1000 10] newtube dup [.5 .6] solidputhuecolors %Cone1 -10 8.543256973 0 [36 72] newconecreux dup (.5 setfillopacity jaune) (.5 setfillopacity jaune) inoutputcolors %Cone2 10 8.543256973 0 [36 72] newconecreux dup (.5 setfillopacity jaune) (.5 setfillopacity jaune) inoutputcolors solidfuz solidfuz drawsolid**