-4

I looked at this beautiful picture for 3 hours, and I would really like to how to this with tikz. If someone have an idea.enter image description here

Stefan Pinnow
  • 29,535
DINEDINE
  • 485
  • Can you show us what you've tried? – Werner Jun 24 '19 at 03:20
  • The tkz-euclide is designed for such tasks. – Henri Menke Jun 24 '19 at 03:52
  • 1
    You should start with what you got, this question leaves all the work to others... – JoeD Jun 24 '19 at 04:40
  • @down-voters: Please don't downvote below a score of -1, even if the question in its current form needs some improvement. A score of -1 is enough to show that the question needs work, anything below that is of no use. Also, if you downvote or vote to close, please leave a comment explaining why you did so, but wait at least 24 hours after asking the OP for improvements to the question before voting to close. – Mensch Jul 03 '19 at 01:10

1 Answers1

15

All you need is to load a few libraries a.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc,through,angles,backgrounds}
\tikzset{circle through 3 points/.style n args={3}{% https://tex.stackexchange.com/a/461180/121799
insert path={let    \p1=($(#1)!0.5!(#2)$),
                    \p2=($(#1)!0.5!(#3)$),
                    \p3=($(#1)!0.5!(#2)!1!-90:(#2)$),
                    \p4=($(#1)!0.5!(#3)!1!90:(#3)$),
                    \p5=(intersection of \p1--\p3 and \p2--\p4)
                    in },
at={(\p5)},
circle through= {(#1)}
}}
\xdef\MyColors{% borrowed from https://tex.stackexchange.com/a/208864/121799
"red",
"red!25",
"magenta",
"magenta!25",
"olive",
"olive!25",
"brown",
"brown!10",
"violet",
"violet!25",
"gray",
"purple",
"yellow",
"orange",
"orange!25",
"cyan",
"green"}%
\newcounter{col}
\begin{document}
\begin{tikzpicture}[every label/.append style={text=black}]
 \draw[green!80!black] 
 (5,3)  coordinate[label=right:$A$] (A)
 -- (1,6) coordinate[label=above left:$B$] (B) 
 -- (0,0) coordinate[label=below left:$C$] (C)   --cycle;
 \draw[purple,thick] foreach \X/\Y [remember=\X as \Z (initially C)] in {A/B,B/C,C/A}
 {(\Y) -- ($(\X)!(\Y)!(\Z)$) coordinate (H\Y) node[pos=1.1] {$H_{\Y}$}};
 \path  (intersection cs:first line={(HC)--(C)}, second line={(HA)--(A)})
 coordinate[label={[text=yellow]above:$H$}] (H);
 \begin{scope}[on background layer]
  \draw[green!80!black,fill=green] (HA) -- (HB) -- (HC) -- cycle;
 \path foreach \X/\Y [remember=\X as \Z (initially C)] in {A/B,B/C,C/A}
 {node[draw=cyan,circle through 3 points={H\X}{H\Y}{\Z}](sc\Z){} 
  node[draw=cyan,circle through 3 points={H\X}{\Y}{\X}](bc\X){}
 [/utils/exec=\stepcounter{col}\pgfmathsetmacro{\mycolor}{{\MyColors}[\number\value{col}]}]
  pic[fill=\mycolor] {angle = H\X--\Y--\X}
 [/utils/exec=\stepcounter{col}\pgfmathsetmacro{\mycolor}{{\MyColors}[\number\value{col}]}]
  pic[fill=\mycolor] {angle = H\X--H\Y--\Z}
  pic[fill=\mycolor] {angle = \X--H\Y--H\Z}
  [/utils/exec=\stepcounter{col}\pgfmathsetmacro{\mycolor}{{\MyColors}[\number\value{col}]}]
  pic[fill=\mycolor] {angle = H\Z--H\Y--H\X}   
  [/utils/exec=\stepcounter{col}\pgfmathsetmacro{\mycolor}{{\MyColors}[\number\value{col}]}]
  pic[fill=\mycolor] {angle = H\Y--H--\X}
  pic[fill=\mycolor] {angle = \Y--H--H\X}
    };
 \end{scope}
\end{tikzpicture}
\end{document}

enter image description here

Or

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc,through,angles,backgrounds}
\tikzset{circle through 3 points/.style n args={3}{% https://tex.stackexchange.com/a/461180/121799
insert path={let    \p1=($(#1)!0.5!(#2)$),
                    \p2=($(#1)!0.5!(#3)$),
                    \p3=($(#1)!0.5!(#2)!1!-90:(#2)$),
                    \p4=($(#1)!0.5!(#3)!1!90:(#3)$),
                    \p5=(intersection of \p1--\p3 and \p2--\p4)
                    in },
at={(\p5)},
circle through= {(#1)}
}}
\xdef\MyColors{% borrowed from https://tex.stackexchange.com/a/208864/121799
"red",
"red!25",
"magenta",
"magenta!25",
"olive",
"olive!25",
"brown",
"brown!10",
"violet",
"violet!25",
"gray",
"purple",
"yellow",
"orange",
"orange!25",
"cyan",
"green"}%
\newcounter{col}
\begin{document}
\begin{tikzpicture}[every label/.append style={text=black},
 next color/.code={\stepcounter{col}\pgfmathsetmacro{#1}{{\MyColors}[\number\value{col}]}},
 angle factor/.style args={#1--#2--#3}{insert path={
 let \p1=($(#1)-(#2)$),\p2=($(#3)-(#2)$),
 \n1={1/abs(sin(atan2(\y1,\x1)-atan2(\y2,\x2)))} in % \pgfextra{\typeout{\n1}}
 }}]
 \draw[green!80!black] 
 (5,3)  coordinate[label=right:$A$] (A)
 -- (1,6) coordinate[label=above left:$B$] (B) 
 -- (0,0) coordinate[label=below left:$C$] (C)   --cycle;
 \draw[purple,thick] foreach \X/\Y [remember=\X as \Z (initially C)] in {A/B,B/C,C/A}
 {(\Y) -- ($(\X)!(\Y)!(\Z)$) coordinate (H\Y) node[pos=1.1] {$H_{\Y}$}};
 \path  (intersection cs:first line={(HC)--(C)}, second line={(HA)--(A)})
 coordinate[label={[text=yellow]above:$H$}] (H);
 \begin{scope}[on background layer]
  \draw[green!80!black,fill=green] (HA) -- (HB) -- (HC) -- cycle;
 \path foreach \X/\Y [remember=\X as \Z (initially C)] in {A/B,B/C,C/A}
 {node[draw=cyan,circle through 3 points={H\X}{H\Y}{\Z}](sc\Z){} 
  node[draw=cyan,circle through 3 points={H\X}{\Y}{\X}](bc\X){}
 [next color=\mycolor,angle factor={H\X--\Y--\X}]
  pic[fill=\mycolor,angle radius=\n1*5mm] {angle = H\X--\Y--\X}
 [next color=\mycolor,angle factor={H\X--H\Y--\Z}]
  pic[fill=\mycolor,angle radius=\n1*5mm] {angle = H\X--H\Y--\Z}
 [angle factor={\X--H\Y--H\Z}] 
  pic[fill=\mycolor,angle radius=\n1*5mm] {angle = \X--H\Y--H\Z}
 [next color=\mycolor,angle factor={H\Z--H\Y--H\X}]
  pic[fill=\mycolor,angle radius=\n1*5mm] {angle = H\Z--H\Y--H\X}   
 [next color=\mycolor,angle factor={H\Y--H--\X}]
  pic[fill=\mycolor,angle radius=\n1*5mm] {angle = H\Y--H--\X}
 [angle factor={\Y--H--H\X}] 
  pic[fill=\mycolor,angle radius=\n1*5mm] {angle = \Y--H--H\X}
    };
 \end{scope}
\end{tikzpicture}
\end{document}

enter image description here