# Knotted Tube

> A rainbow tube around the (3, 5) torus knot, built on its Frenet frame.

The curve $f(s) = (\sin 2s + 2\sin 3s,\ \cos 2s - 2\cos 3s,\ -\sin 5s)$ is the $(3, 5)$ torus knot: its distance from the vertical axis is $\sqrt{5 - 4\cos 5s}$ and its height is $-\sin 5s$, so it lies on a surface shaped like a torus, winding 3 times around the axis and 5 times around the tube. It has 10 crossings and five-fold symmetry. The same formula with frequencies 1, 2 and 3 gives the trefoil knot.

To give the curve thickness, the tube follows its Frenet frame. The derivatives $f'$ and $f''$ are written in closed form, the binormal is the direction of $f' \times f''$, and the normal is the binormal crossed with the tangent. A circle of radius $c = 0.3$ in the plane of the normal and the binormal then sweeps along the knot: $g(s, w) = f(s) + c(\cos w\, N(s) + \sin w\, B(s))$. On this curve $f'$ and $f''$ are never parallel, so the frame never flips and the tube stays smooth. The knot is split into five parametric surfaces, one per fifth of its length, each with its own hue.

After a Desmos graph by u/dohduhdah.

- [Open the interactive version](https://graph-paper.io/showcase/en/frenet-knot-tube)
- [Learn more on Wikipedia](https://en.wikipedia.org/wiki/Torus_knot)
