1
$\begingroup$

I'd like to plot together a torus and a knot on it, that is, closed curve wrapping around the torus, $m$ times around a circle and $n$ times around the other circle.

It will be used to explain fundamental group of torus $\pi_1(T)\simeq \mathbb{Z}\oplus \mathbb{Z}$.

I think that there is a better way to plot the knot. Also, I'd like to change its thickness and colour.

If possible, I'd like to use selectors to change $m$ and $n$ interactively.

Code

rr = 2; torus[u_,v_] := { (rr + Cos[2 Pi u]) Cos[2 Pi v], (rr + Cos[2 Pi u]) Sin[2 Pi v], Sin[2 Pi u] } Toro = ParametricPlot3D[torus[u, v], {u, 0, 1}, {v, 0, 1}, Boxed -> False, Axes -> False, MeshStyle -> None]; Knot = ParametricPlot3D[torus[u, 2 u], {u, 0, 1}, Boxed -> False, Axes -> False]; Show[Toro, Knot] 

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Could you put m and n in your code? $\endgroup$ Commented Nov 19, 2014 at 0:47
  • $\begingroup$ @VitaliyKaurov, $m$ and $n$ should be used within torus[m u, n u]. $\endgroup$ Commented Nov 19, 2014 at 15:40
  • $\begingroup$ Pretty reminiscent of this question: mathematica.stackexchange.com/questions/7545/… $\endgroup$ Commented Dec 5, 2014 at 23:08

1 Answer 1

2
$\begingroup$
 Manipulate[ Module[{rr = 2}, torus[u_, v_] := {(rr + Cos[2 \[Pi] u]) Cos[ 2 \[Pi] v], (rr + Cos[2 \[Pi] u]) Sin[2 \[Pi] v], Sin[2 \[Pi] u]}; Toro = ParametricPlot3D[torus[u, v], {u, 0, 1}, {v, 0, 1}, Boxed -> False, Axes -> False, MeshStyle -> None]; Knot = ParametricPlot3D[torus[m u, 2 n u], {u, 0, 1}, Boxed -> False, Axes -> False, PlotStyle -> {Thickness[0.01], Blue}]]; Show[Toro, Knot], {{m, 3}, 1, 15, 1}, {{n, 4}, 1, 15, 1}] 

Torus fig

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.