%% d'apres les donnees de %% http://www.mathcurve.com/courbes3d/solenoidtoric/solenoidtoric.shtml -3 3 setxrange -2.5 2 setyrange 50 setxunit 30.01 30 50 SetCamPos 0 0 0 SetCamView %/ScreenDist .05 def -10 10 setxrange3d -3 3 setyrange3d 2 setlinejoin /m 12 def %% ex R /r 4 def /n 5 4 div 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 %% 300 setresolution %% rouge %% 0 pi 8 mul {g} CourbeR3 %% stop .1 setlinewidth %/aretescachees false def GetCamPos setlightsrc %solidgridOff 0 pi 8 mul (g) 1 [800 12] newtube dup [.5 .6] solidputhuecolors drawsolid**