Message Boards Message Boards

[GIF] Inevitability ((7, 3)-torus knot)

(7, 3)-torus knot

Inevitability

Same basic code as To Infinity, but this time with a $(7,3)$ torus knot and simpler lighting. Also, viewed from above rather than from the front.

Stereo3D[{x1_, y1_, x2_, y2_}] := {x1/(1 - y2), y1/(1 - y2), x2/(1 - y2)};

pqtorus[t_, p_, q_] := 1/Sqrt[2] {E^(p I t), E^(q I t)};

With[{viewpoint = {0, 0, 10}, 
  cols = RGBColor /@ {"#EDF2F6", "#494953"}},
 Manipulate[
  Graphics3D[{Sphere[#, .1] & /@ 
     Table[Stereo3D[Flatten[ReIm /@ pqtorus[t + θ, 7, -3]]], {t, 0, 2 Pi, 2 Pi/200}]}, 
   PlotRange -> 3, ViewPoint -> viewpoint, 
   ViewVertical -> {0, 1, 0}, Boxed -> False, 
   Background -> cols[[-1]], ImageSize -> 540,
   Lighting -> {{"Point", cols[[1]], {0, 0, 1/2}}, {"Ambient", cols[[-1]], viewpoint}}],
  {θ, 0, Pi/100}]
 ]
3 Replies

Jeez. Every time I learn about some new function I'd never heard of before (Most this time).

enter image description here - Congratulations! This post is now a Staff Pick! Thank you for your wonderful contributions. Please, keep them coming!

POSTED BY: EDITORIAL BOARD
Posted 8 years ago

Some slight shortening:

With[{viewpoint = {0, 0, 10}, cols = RGBColor /@ {"#EDF2F6", "#494953"}}, 
        Manipulate[Graphics3D[{Sphere[Table[(Most[#]/(1 - Last[#])) & [
                                            Flatten[ReIm[Exp[{7, -3} I (t + θ)]/Sqrt[2]]]],
                                            {t, 0, 2 Pi, 2 Pi/200}], 0.1]}, Background -> cols[[-1]],
                               Boxed -> False, ImageSize -> 540, 
                               Lighting -> {{"Point", cols[[1]], {0, 0, 1/2}},
                                            {"Ambient", cols[[-1]], viewpoint}}, PlotRange -> 3, 
                               ViewPoint -> viewpoint, ViewVertical -> {0, 1, 0}], {θ, 0, Pi/100}]]
POSTED BY: J. M.
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract