Some Tikz pictures

Most LaTeX-ers know about Tikz, which allows the user to create images in LaTeX without having to embed images created from an external program. The main advantages are that

  1. The ambient LaTeX fonts are used in the image, so labels and such conform to the ambient style of the document.
  2. The size of the .tex file is kept small, since it is only text you are creating.
  3. It yields a picture that is smooth and that looks good upon zooming in (i.e., the resolution of the picture is good).
  4. It is functional code so that you can automate the drawing of many pictures by giving commands such as “draw a line between these two points”.

The main disadvantage, is that there is a steep learning curve. The best way to learn is through examples, and even though I’m still a hack, my tikz code has improved via my copying segments of other people’s code. For geometry, there isn’t much out there, so I thought that I would dump some images here. Below are some Tikz pictures of configurations in finite geometry that I’ve collected and think should be available for everyone else to use. A big thanks to Stephen Glasby who went to a lot of trouble to make the two generalised hexagons of order 2. If you have suggestions on how I can simplify my code, please let me know.

Desargues’ configuration, two ways

Desargues1

\begin{tikzpicture}
\tikzstyle{point1}=[ball color=cyan, circle, draw=black, inner sep=0.1cm]
\tikzstyle{point2}=[ball color=green, circle, draw=black, inner sep=0.1cm]
\tikzstyle{point3}=[ball color=red, circle, draw=black, inner sep=0.1cm]
\node (v1) at (0,8) [ball color=blue, circle, draw=black, inner sep=0.1cm] {};
\node (v2) at (0,6) [point1] {};
\node (v3) at (2,5.5) [point1] {};
\node (v4) at (1.5,4) [point1] {};
\node (v5) at (0,0) [point2] {};
\node (v6) at (2.75*2,8-2.75*2.5) [point2] {};
\node (v7) at (1.5*1.5,8-1.5*4) [point2] {};
\draw (v1) -- (v2) -- (v5);
\draw (v1) -- (v3) -- (v6);
\draw (v1) -- (v4) -- (v7);
\draw (v2) -- (v3) -- (v4) -- (v2);
\draw (v5) -- (v6) -- (v7) -- (v5);
\node (v8) at (intersection of v2--v3 and v5--v6) [point3] {};
\node (v9) at (intersection of v2--v4 and v5--v7) [point3] {};
\node (v10) at (intersection of v3--v4 and v6--v7) [point3] {};
\draw (v3) -- (v8) -- (v6);
\draw (v4) -- (v9) -- (v7);
\draw (v4) -- (v10) -- (v7);
\draw (v8) -- (v9) -- (v10);
\end{tikzpicture}

… and the second one:
Desargues2

\begin{tikzpicture}
\tikzstyle{point} = [ball color=black, circle,  draw=black, inner sep=0.1cm]
\foreach\x in {0, 72, 144, 216, 288}{
    \begin{scope}[rotate=\x]
      \coordinate (o1) at (-0.588, -0.809);
      \coordinate (o2) at (0.588, -0.809);
      \coordinate (c1) at (-1.1, 4.6);
      \coordinate (c2) at (1.1, 4.6);
      \coordinate (o3) at (0, 3.236);
      \draw[color=black] (o3) -- (3.236*-0.588, 3.236*-0.809);
      \draw[color=blue] (o1) ..  controls (c1) and (c2) ..  (o2);
     \end{scope}
}
\foreach\x in {0, 72, 144, 216, 288}{
    \begin{scope}[rotate=\x]
      \coordinate (o2) at (0.588, -0.809);
      \coordinate (o3) at (0, 3.236);
      \fill[point] (o2) circle (2pt);
      \fill[point] (o3) circle (2pt);
    \end{scope}
}
\end{tikzpicture}

The generalised quadrangle of order 2

I think Gordon gave me the original tikz code for this and then I tweaked it.
GQ2

\begin{tikzpicture}
\tikzstyle{point}=[ball color=magenta, circle, draw=black, inner sep=0.1cm]
\foreach \x in {18,90,...,306}{
\node [point] (t\x) at (\x:2.65){};
}
\foreach \x in {54,126,...,342}{
\draw [color=blue, double=green](\x:1cm) circle (1.17557cm);
}
\fill [white] (0,0) circle (1cm);
\foreach \x in {54,126,...,342}{
\node[point] (i\x) at (\x:1cm) {};
\node[point] (o\x) at (\x:2.17557cm) {};
}

\draw [color=blue,double=green] (t90)--(o126)--(t162)--(o198)--(t234)--(o270)--(t306)--(o342)--(t18)--(o54)--(t90);
\draw (t90)--(i270)--(o270);
\draw (t162)--(i342)--(o342);
\draw (t234)--(i54)--(o54);
\draw (t306)--(i126)--(o126);
\draw (t18)--(i198)--(o198);
\end{tikzpicture}

The two generalised hexagons of order 2

These pictures were originally drawn by Schroth in his 1999 paper, and then appeared in Burkard Polster’s book “A geometrical picture book”.

GH2_1

\begin{tikzpicture}
    \foreach\n in {0, 1,..., 6}{
      \begin{scope}[rotate=\n*51.4286]
        \coordinate (a0) at (10,0);
        \coordinate (b0) at (7,0);
        \coordinate (c0) at (1.45,0);
        \coordinate (d0) at (4.878,-0.4878);
        \coordinate (e0) at (2.1729,0.37976);
        \coordinate (f0) at (1.45,0.612);
        \coordinate (g0) at (2.78,-0.585);
        \coordinate (h0) at (4.074,0.7846);
        \coordinate (i0) at (6.0976,2.9268);
        \foreach\k in {1, 2,..., 6}{
          \foreach\p in {a,b,c,d,e,f,g,h,i}{
            \coordinate (\p\k) at ($ (0,0)!1! \k*51.4286:(\p0) $);
          }
        }
        \draw[thick,blue] (a0)--(b0)--(c0);
        \draw[thick,blue] (d0)--(e0)--(f0);
        \draw[thick,black] (g0)--(h0)--(i0);
        \draw[thick,black] (a0)--(g1)--(a3);
        \draw[thick,green] (i0)--(d1)--(i2);
        \draw[thick,black] (c0)--(g3)--(d3);
        \draw[thick,color=purple] (b0) .. controls (5.7,-1.8) and (4.6,-2.2)
           .. (h6) .. controls (1.5,-3.2) and (-1,-2.4) .. (e4);
        \draw[thick,black] (b0)--(h0)--(e2);
        \draw[thick,purple] (f6)--(c0)--(f0);
        \foreach\k in {1, 2,..., 6}{
          \foreach\p in {a,b,c,d,e,f,g,h,i}{
            \draw[fill] (\p\k) circle [radius=0.12];
          }
        }
     \end{scope}
   }
\end{tikzpicture}

 

GH2_2

\begin{tikzpicture}
  \foreach\n in {0, 1,..., 6}{
      \begin{scope}[rotate=\n*51.4286]
        \coordinate (a0) at (85,0);
        \coordinate (b0) at (55,0);
        \coordinate (c0) at (12.5,0);
        \coordinate (d0) at (8.5,1.3);
        \coordinate (e0) at (16.2,9);
        \coordinate (f0) at (30,14.3);
        \coordinate (g0) at (26.6,17.0);
        \coordinate (h0) at (26.3,22.4);
        \coordinate (i0) at (29.5,28);
        \foreach\k in {1, 2,..., 6}{
          \foreach\p in {a,b,c,d,e,f,g,h,i}{
            \coordinate (\p\k) at ($ (0,0)!1! \k*51.4286:(\p0) $);
          }
        }
        \draw[thick,black] (a0)--(e1)--(a3);
        \draw[thick,green] (b0)--(h0)--(b2);
        \draw[thick,purple] (f0)--(g0)--(f1);
        \draw[thick,blue] (h0)--(i0)--(a1);
        \draw[thick,purple] (h6)--(c0)--(d0);
        \draw[thick,purple] (f0)--(e0)--(i3);
        \draw[thick,black] (b0)--(i6)--(g6);
        \draw[thick,color=blue] (g0) .. controls (27,2) and (17,-5)
           .. (d6) .. controls (-7,-5) and (-5,-5) .. (c3);
        \draw[thick,color=blue] (c0) .. controls (16,3) and (17,5)
           .. (e0) .. controls (15,13) and (8,15) .. (d1);
        \foreach\k in {1, 2,..., 6}{
          \foreach\p in {a,b,c,d,e,f,g,h,i}{
            \draw[fill] (\p\k) circle [radius=1.1];
          }
        }
      \end{scope}
  }
\end{tikzpicture}

The first is the Split Cayley hexagon as it is usually given, whilst the second is its dual.

 

The projective plane of order 2

Fano

\begin{tikzpicture}
\tikzstyle{point}=[ball color=cyan, circle, draw=black, inner sep=0.1cm]
\node (v7) at (0,0) [point] {};
\draw (0,0) circle (1cm);
\node (v1) at (90:2cm) [point] {};
\node (v2) at (210:2cm) [point] {};
\node (v4) at (330:2cm) [point] {};
\node (v3) at (150:1cm) [point] {};
\node (v6) at (270:1cm) [point] {};
\node (v5) at (30:1cm) [point] {};
\draw (v1) -- (v3) -- (v2);
\draw (v2) -- (v6) -- (v4);
\draw (v4) -- (v5) -- (v1);
\draw (v3) -- (v7) -- (v4);
\draw (v5) -- (v7) -- (v2);
\draw (v6) -- (v7) -- (v1);
\end{tikzpicture}
Advertisements

4 thoughts on “Some Tikz pictures

Add yours

  1. The pictures of the hexagons are beautiful. Can you please upload them on the wikipedia page of generalized polygons? I would do it on my own but it’s asking me copyright related questions that are a bit tricky for me.

  2. A small issue with the hexagon images is that some of the lines are crossing over the black dots that are points. It can be fixed by adding another loop in the end which just draws the points. Oh also, the scaling in the second image is way off I think.

Leave a Reply to John Bamberg Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Up ↑

%d bloggers like this: