this is my first question in this forum. I want to draw something like a picture from the Wikipedia article about the circle.
This is the picture.
This is what I want to achieve:
- The circle chord should be in blue. The endpoints of the circle chord (which are on the circle) should be named A and B and shall be written in blue like the chord.
- The circle arc between A and B shall be red.
- The line segments from the midpoint to A and midpoint to B shall be dashed and green.
- Additionally there shall be a short arc which shall picture the angle alpha both in green.
- The circle chord and the circle arc shall be named and the names colored.
- I'm unsure how to specify points A and B. In my attempt, I simply drew a line and then calculated the intersection points with the circle. Maybe there are better programming solutions that are less random.
- And I don't like the solution with \def which is a LaTeX primitive, I don't want to risk and redefine an existing command. Maybe there is an alternative solution for that. I had to do that because it is not possible to use the color{}{} command within the (name intersections ... by)-part.
\documentclass[border=0.5cm]{standalone}
% PGF/TikZ
\usepackage{tikz}
\usetikzlibrary{positioning, arrows, shapes, trees, intersections}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[
help lines/.style = {very thin, color=gray!50},
dot/.style = {circle, fill, inner sep=0pt, radius=2cm}
]
\def\Ca{\textcolor{blue}{$C$}}
\def\Cb{\textcolor{blue}{$C'$}}
\draw[help lines] (-2.5,-2.5) grid (2.5,2.5);
\draw[name path=Circle] (0,0) circle[radius=2cm];
\coordinate[label=below:$M$] (M) at (0,0);
\node[draw,fill,circle,inner sep=0pt] at (M) {};
\path[name path={Sekante1}] (-2.5,-0.5) -- (2.5,2);
\path[name intersections={of=Sekante1 and Circle, by={[label=right:\Cb]C2, [label=left:\Ca]C1}}];
\draw[blue!50, thick] (C1) -- (C2);
\draw[green, dashed] (M) -- (C1);
\draw[green, dashed] (M) -- (C2);
\node[dot] at (C1) {};
\end{tikzpicture}
\end{document}
Result: