It is my first time to try to draw knot in TeX, and I find a a tutorial for drawing knot: https://loopspace.mathforge.org/HowDidIDoThat/TeX/NewKnots/ But I encountered some difficities in trying to understand it.
How does "controls" work in the following code?
\begin{tikzpicture} \path[spath/save=trefoil] (0,2) .. controls +(2.2,0) and +(120:-2.2) .. (210:2) .. controls +(120:2.2) and +(60:2.2) .. (-30:2) .. controls +(60:-2.2) and +(-2.2,0) .. (0,2); \tikzset{ every trefoil component/.style={draw}, trefoil component 1/.style={blue}, trefoil component 2/.style={green, dashed, |<->|}, trefoil component 3/.style={magenta, line width=2pt}, spath/knot={trefoil}{15pt}{1,3,5}, } \end{tikzpicture}
I understand that (0, 2) (210: 2) (-30: 2) are three points in the plane. But what does, for example, controls +(2.2, 0) mean? I tried to draw help lines and I find that +(2.2, 0) does not mean the point (2.2, 0). It makes me confused.
- Can I modifiy the following codes to get a figure 8 knot with orientation and labels?
\begin{tikzpicture}[use Hobby shortcut]
\path[spath/save=figure8]
([closed]0,0) .. (1.5,1) .. (.5,2) ..
(-.5,1) .. (.5,0) .. (0,-.5) .. (-.5,0) ..
(.5,1) .. (-.5,2) .. (-1.5,1) .. (0,0);
\tikzset{
every spath component/.style={draw},
spath/knot={figure8}{15pt}{1,3,...,7}
}
\path (0,-.7);
\end{tikzpicture}
In this document, the author give a example code of figure 8 knot. But I what to add arrows and labels. It seems I can achieve it to modify the example of trefoil. I thinke If I can really understand how "contros" works in the example of trefoil, combining the coordinates in the example of figure 8, maybe I can draw what I want.
Here is another question related to mine:How do I draw the orientation of a knot in TikZ? But somehow, my computer can't compile the code in it.
The following picture is what I am trying to draw.


+(...)defines relative coordinates, you can find out about them in the TikZ manual. For the second part, it would seem that you are trying to add labels and decorations to a path, which doesn't involve changing the actual path, so you don't need to mess around with the construction. Could you add an image of what you're after? Hand drawn is fine. – Andrew Stacey Mar 23 '22 at 06:40controlspart is to do with how tikz constructs paths and is covered in the manual. – Andrew Stacey Mar 23 '22 at 11:57