I am trying to make a "pretty" picture of a torus in $\mathbb{R}^3$ which does not bound a solid torus. The standard way of constructing such a thing is to first take a non-trivial torus knot:
f[t_, s_] := {(2 + Cos[s]) Cos[t], (2 + Cos[s]) Sin[t], Sin[s]} -
{2,0, 0}
ParametricPlot3D[f[t, 3 t/2], {t, 0, 4 Pi}]
This is the trefoil knot (the minus $\lbrace2,0,0\rbrace$ will be explained shortly). We then take a tubular neighborhood around this knot:
Needs["VectorAnalysis`"]
df[t_] := Evaluate[D[f[t, 3 t/2], t]]
v1[t_] := CrossProduct[df[t], {0, 1, 0}] // Normalize
v2[t_] := CrossProduct[df[t], v1[t]] // Normalize
ParametricPlot3D[
f[t, 3 t/2] + Cos[\[Theta]] v1[t] + Sin[\[Theta]] v2[t],
{t, 0,4 Pi}, {\[Theta], 0, 2 Pi}, Mesh -> None]
(I checked beforehand that the derivative is never in the $\lbrace0,1,0\rbrace$ direction.)
Now I define the composition of a stereographic projection to $S^3$, and one back to $\mathbb{R}^3$. The key is that the latter map can be from any point, so I simply pick one that lies on my knot! [This is why I subtracted $\lbrace2,0,0\rbrace$ before: it ensures the origin lies on the knot, and gives this composition a very easy form.]
s3Proj[v_]:=v/(Norm[v]^2)
ParametricPlot3D[s3Proj[
f[t, 3 t/2] + Cos[\[Theta]] v1[t] + Sin[\[Theta]] v2[t]],
{t, 0,4 Pi}, {\[Theta], 0, 2 Pi}, Mesh -> None]
The problem is (I don't know how to include the picture) that Mathematica is not drawing this torus the way I want. By looking at the "general shape", I know it is the right torus, but for some reason Mathematica is "flaying" the ends of this torus out. I think the problem is due to the fact that any such torus has to travel "inside" itself (basically tracing the knot and then "exiting" itself again), and Mathematica gets confused in how to draw that.
Is there some way to "clean up" this plot? Or maybe someone knows another way to draw an attractive version of this torus?
[My browser is acting up and I cannot tag this question; please feel free to tag it for me.]
ParametricPlot3D
command correct? (s3Proj
is never used) $\endgroup$KnotData
. You can get a trefoil withKnotData["Trefoil"]
and its parametric curve withKnotData["Trefoil", "SpaceCurve"]
$\endgroup$