%% d'apres les donnees de %% http://www.mathcurve.com/courbes3d/solenoidtoric/solenoidtoric.shtml -6 6 setxrange -6 6 setyrange 50 setxunit 0.01 0 50 SetCamPos 0 0 0 SetCamView -10 10 setxrange3d -3 3 setyrange3d 2 setlinejoin /m 15 def %% ex R /r 6 def /n 2 def /g { 3 dict begin settvar #rpn# (m+r*Cos(n*t))*Cos(t) #rpn# (m+r*Cos(n*t))*Sin(t) #rpn# r*Sin(n*t) end } def /g' { 3 dict begin settvar #rpn# -n*r*Sin(n*t)*Cos(t) - (m+r*Cos(n*t))*Sin(t) #rpn# -n*r*Sin(n*t)*Sin(t) + (m+r*Cos(n*t))*Cos(t) #rpn# n*r*Cos(n*t) end } def /g'' { 3 dict begin settvar #rpn# -n^2*r*Cos(n*t)*Cos(t) +n*r*Sin(n*t)*Sin(t) + n*r*Sin(n*t)*Sin(t) - (m+r*Cos(n*t))*Cos(t) #rpn# -n^2*r*Cos(n*t)*Sin(t) -n*r*Sin(n*t)*Cos(t) - (n*r*Sin(n*t))*Cos(t) - (m+r*Cos(n*t))*Sin(t) #rpn# -n^2*r*Sin(n*t) end } def %% rouge 0 pi 2 mul {g} CourbeR3 % stop .1 setlinewidth GetCamPos setlightsrc %solidgridOff 0 pi 2 mul (g) 2 [200 8] newtube dupsolid dup [.5 .6] solidputhuecolors exch {0 0 90 rotateOpoint3d} solidtransform dup [0 .1] solidputhuecolors solidfuz %dup videsolid drawsolid**