set pm3d depth lighting set object rect from sc 0,0 to sc 1,1 behind fc "#114400" set palette defined (0 "#6666ff", 1 "#6666ff") set samples 256 set isosamples 24 unset border unset tics unset colorbox unset key set xyplane 0 set view 30,0, 1.8, 1.8 set term pngcairo size 360,360 set out "torus-knot.png" set parametric set urange [0:2*pi] set vrange [0:2*pi] r = 0.08 R1 = 1 R2 = 0.15 p = 5 q = 3 c = R1 + R2 + r set zrange [-c:c] set xrange [-c:c] set yrange [-c:c] x(u,v) = (R1 + R2*cos(p*u) + r*cos(v))*cos(q*u) y(u,v) = (R1 + R2*cos(p*u) + r*cos(v))*sin(q*u) z(u,v) = r*sin(v) + R2*sin(p*u) splot x(u,v), y(u,v), z(u,v) w pm3d !display "torus-knot.png" |