I have used the following code to create triangles inside a circle which works really well. Can anybody point me in the direction to somewhere I can learn to adapt this code so for example creating the double angle rule or cyclic quadrilaterals?
\documentclass[tikz,margin=2mm,5pt]{standalone}
\usetikzlibrary {angles,quotes}
\usetikzlibrary{calc,positioning}
\pgfmathsetseed{\pdfuniformdeviate 10000000}
\usepackage{scrextend}
\changefontsizes[10pt]{5pt}
\pgfdeclarelayer{back}
\pgfdeclarelayer{front}
\pgfsetlayers{back,main,front}
\begin{document}
\foreach \p in {{A/2,B/2,C/4,D/5},{A/2,B/3,C/4,D/6,E/9}}{
\begin{tikzpicture}
\pgfmathsetmacro\r{2cm} \pgfmathsetmacro\ld{3mm}
\foreach \l/\v[evaluate=\v as \s using \s + \v,remember=\s as \s (initially 0),
remember=\l as \ls,remember=\v as \lv] in \p{}
\pgfmathsetmacro\unit{360/\s} \pgfmathsetmacro\ai{rnd*360}
\fill circle(1pt) coordinate (I); \draw circle(\r pt);
\draw (\ai:\r pt)
\foreach \l/\v[evaluate=\v as \s using \psum + \v, remember=\s as \psum (initially 0)]
in \p {-- ({\unit*\psum+\ai}:\r pt) coordinate (\l)} -- cycle;
\foreach \l/\v in \p {
\draw (I) -- (\l); \fill (\l) circle (1pt);
\node at ($(I)!\r pt+\ld pt!(\l)$) {$\l$};
}
\node[circle,inner sep=0.1pt] at ($(I) + (\ai:3mm)$) {$O$}; %labeled O But Referenced I
\foreach \l/\v[remember=\l as \pl (initially \ls),remember=\v as \pv (initially \lv)]
in \p {\node at ($(I)!\r pt+\ld pt!($(\pl)!.5!(\l)$)$) {\pv};}
\end{tikzpicture}
}
\end{document}
I don't know if this out of the purview of this site, I am asking for help on where to learn (but obviously any help would be nice). Thanks
texdoc pgfmanual
(look up\foreach
,\pgfmathsetmacro
etc. to see what they do) If something doesn't make sense you might have to resort to learn how the underlying engine work, read TeXbook/TeX by topic etc.)