TikZ Challenge 1 - Geometrical Diagram - Votes

In summary, the conversation was about a challenge to create an interesting geometrical diagram and the voting for the submissions. The contributions included a triangle with labeled coordinates, an illustration of the altitudes of a triangle, a direction field for a magnetic dipole, and a TikZ picture demonstrating the foundation of trigonometry. The voting is now closed with 15 voters and a big thanks to all contributors.

What is the best TikZ contribution for a geometrical diagram?


  • Total voters
    15
  • Poll closed .
  • #1
I like Serena
Homework Helper
MHB
16,336
258
Hey all,

2 weeks ago I created a challenge to create a geometrical diagram, like a triangle, that is somehow interesting or impressive.
Now the moment of truth is here. Please everyone, give your vote!
Voting will close in 2 weeks time.

Let me recap the submissions.I like Serena

\begin{tikzpicture}[blue]
\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (4,3);
\draw[blue, ultra thick] (A) -- (B) -- (C) -- cycle;
\path (A) node[below left] {A} -- (B) node[below right] {B} -- (C) node[above] {C};
\path (A) -- node[below] {c} (B) -- node
{a} (C) -- node[above left] {b} (A);
\path (A) node[above right, xshift=12] {$\alpha$};
\draw[thick] (B) rectangle +(-0.4,0.4);
\draw[thick] (A) +(1,0) arc (0:atan(3/4):1);
\end{tikzpicture}
[latexs]
\begin{tikzpicture}[blue]
\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (4,3);
\draw[blue, ultra thick] (A) -- (B) -- (C) -- cycle;
\path (A) node[below left] {A} -- (B) node[below right] {B} -- (C) node[above] {C};
\path (A) -- node[below] {c} (B) -- node
{a} (C) -- node[above left] {b} (A);
\path (A) node[above right, xshift=12] {$\alpha$};
\draw[thick] (B) rectangle +(-0.4,0.4);
\draw[thick] (A) +(1,0) arc (0:atan(3/4):1);
\end{tikzpicture}
[/latexs]
This picture is special because it's a basic shape that showcases:
  1. Naming coordinates.
  2. Drawing a closed polygon.
  3. Embellishing with properties (for color and thickness).
  4. Adding labels next to nodes and next to lines.
  5. Specifying relative coordinates.
  6. Drawing an arc.
  7. Using a mathematical function (for the angle of the arc).
greg1313

\begin{tikzpicture}[scale=2]
\usetikzlibrary{calc}
\coordinate (A) at (0,0);
\coordinate (B) at (1,2.5);
\coordinate (C) at (4,0);
\draw (A) -- (B) -- (C) -- cycle;
\draw (B) -- ($(A)!(B)!(C)$) ++(90:0.2) -- ++(0:0.2) -- +(-90:0.2);
\draw (A) -- ($(B)!(A)!(C)$) ++(-39.806:0.2) -- ++(50.194:-0.2) -- +(-39.806:-0.2);
\draw (C) -- ($(A)!(C)!(B)$) ++(68.2:-0.2) -- ++(-21.8:0.2) -- +(68.2:0.2);
\draw (A) node
{$A$} -- (B) node[above]{$B$}node[midway,above]{$c\quad$} -- (C)node
{$C$}node[midway,above]{$\quad a$} -- (A)node[midway,below]{$b$};
\node[align=center,font=\bfseries, yshift=2em] (title)
at (current bounding box.north)
{An illustration of the altitudes of a triangle, \\ intersecting at a single point called the orthocenter};
\end{tikzpicture}
[latexs]
\begin{tikzpicture}[scale=2]
\usetikzlibrary{calc}
\coordinate (A) at (0,0);
\coordinate (B) at (1,2.5);
\coordinate (C) at (4,0);
\draw (A) -- (B) -- (C) -- cycle;
\draw (B) -- ($(A)!(B)!(C)$) ++(90:0.2) -- ++(0:0.2) -- +(-90:0.2);
\draw (A) -- ($(B)!(A)!(C)$) ++(-39.806:0.2) -- ++(50.194:-0.2) -- +(-39.806:-0.2);
\draw (C) -- ($(A)!(C)!(B)$) ++(68.2:-0.2) -- ++(-21.8:0.2) -- +(68.2:0.2);
\draw (A) node
{$A$} -- (B) node[above]{$B$}node[midway,above]{$c\quad$} -- (C)node
{$C$}node[midway,above]{$\quad a$} -- (A)node[midway,below]{$b$};
\node[align=center,font=\bfseries, yshift=2em] (title)
at (current bounding box.north)
{An illustration of the altitudes of a triangle, \\ intersecting at a single point called the orthocenter};
\end{tikzpicture}
[/latexs]
This TikZ diagram includes a title.MarkFL

\begin{tikzpicture}
\draw[<->][red] (-5.5,0) -- (5.5,0) node
{$x$};
\draw[<->][red] (0,-5.5) -- (0,5.5) node[above] {$y$};
\foreach \x in {-5,-4.5,...,-0.5,0.5,1,...,5}
{
\foreach \y in {-5,-4.5,...,-0.5,0.5,1,...,5}
{
\def \angle {atan((3*\x*\y)/(2*(\x)^2-(\y)^2))};
\draw[thick,blue] ({\x + 0.1*cos(\angle)},{\y + 0.1*sin(\angle)}) -- ({\x + 0.1*cos(\angle + 180)},{\y + 0.1*sin(\angle + 180)});
}
}
\end{tikzpicture}
[latexs]
\begin{tikzpicture}
\draw[<->][red] (-5.5,0) -- (5.5,0) node
{$x$};
\draw[<->][red] (0,-5.5) -- (0,5.5) node[above] {$y$};
\foreach \x in {-5,-4.5,...,-0.5,0.5,1,...,5}
{
\foreach \y in {-5,-4.5,...,-0.5,0.5,1,...,5}
{
\def \angle {atan((3*\x*\y)/(2*(\x)^2-(\y)^2))};
\draw[thick,blue] ({\x + 0.1*cos(\angle)},{\y + 0.1*sin(\angle)}) -- ({\x + 0.1*cos(\angle + 180)},{\y + 0.1*sin(\angle + 180)});
}
}
\end{tikzpicture}
[/latexs]
This TikZ diagram illustrates a direction field for a magnetic dipole, and utilizes the following:
  • Nodes for the axis labels.
  • Nested foreach loops.
  • The definition of an angle (slope) based on coordinates.
  • Parametric values for the endpoints of line segments.
lfdahl

[TIKZ][scale=3]
\draw[step=.5cm, gray, very thin] (-1.2,-1.2) grid (1.2,1.2);
\filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle;
\draw[->] (-1.25,0) -- (1.25,0) coordinate (x axis);
\draw[->] (0,-1.25) -- (0,1.25) coordinate (y axis);
\draw (0,0) circle (1cm);
\draw[very thick,red] (30:1cm) -- node[left,fill=white] {$\sin \alpha$} (30:1cm |- x axis);
\draw[very thick,blue] (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
\draw (0,0) -- (30:1cm);
\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$};
\foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$};
[/TIKZ]
[latexs]
[TIKZ][scale=3]
\draw[step=.5cm, gray, very thin] (-1.2,-1.2) grid (1.2,1.2);
\filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle;
\draw[->] (-1.25,0) -- (1.25,0) coordinate (x axis);
\draw[->] (0,-1.25) -- (0,1.25) coordinate (y axis);
\draw (0,0) circle (1cm);
\draw[very thick,red] (30:1cm) -- node[left,fill=white] {$\sin \alpha$} (30:1cm |- x axis);
\draw[very thick,blue] (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
\draw (0,0) -- (30:1cm);
\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$};
\foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$};
[/TIKZ]
[/latexs]
This TikZ picture is special, because it demonstrates:
- The very foundation of trigonometry
- Construction of a coordinate system
- Construction of a grid
- Coloring of line segments
- The making of tick labels
- How to fill in with colors
- How to use different line thickness
- How to position labels​
 
Mathematics news on Phys.org
  • #2
Voting is over.
Thank you all for taking the time to take a look and vote. We have 15 voters!
The result:
  1. MarkFL
  2. I like Serena
  3. lfdahl
  4. greg1313
A big hurray for every one of the contributors. Thank you for your efforts!

Thread closed.
 

1. What is the purpose of "TikZ Challenge 1 - Geometrical Diagram - Votes"?

The purpose of this challenge is to encourage users to create a geometrical diagram using the TikZ package, which is a powerful tool for creating high-quality graphics in LaTeX. This challenge also allows users to vote for their favorite diagrams and learn from each other's approaches.

2. Do I need any prior experience with TikZ to participate in this challenge?

While some experience with TikZ may be helpful, it is not necessary to participate in this challenge. The challenge is open to all levels of expertise and is a great opportunity to learn and improve your skills.

3. How do I submit my entry for the challenge?

To submit your entry, simply post your diagram on the designated forum thread or hashtag it on social media with the designated hashtag. Make sure to follow the guidelines and include the necessary information such as the code and a brief description of your approach.

4. Can I use other packages or software to create my diagram?

The challenge specifically requires the use of the TikZ package. However, you are free to use other packages or software to aid in your diagram creation, as long as the final result is created using TikZ.

5. Is there a prize for the winner of the challenge?

While there is currently no official prize for the winner, the challenge aims to foster a sense of community and learning among users. The winner will also have the satisfaction of having their diagram recognized and appreciated by their peers.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
700
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
Back
Top