# Plotting knot torus

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] • Could you put m and n in your code? Nov 19, 2014 at 0:47
• @VitaliyKaurov, $m$ and $n$ should be used within torus[m u, n u]. Nov 19, 2014 at 15:40
• Pretty reminiscent of this question: mathematica.stackexchange.com/questions/7545/… Dec 5, 2014 at 23:08

 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}] 