Last active
June 5, 2021 11:17
-
-
Save shihashi/9e90224be537457b58ad0bdb0687d26c to your computer and use it in GitHub Desktop.
Draw a incircle given the length of the three sides of the triangle.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article}% Typeset by pdfLaTeX | |
\usepackage{tikz} | |
\begin{document} | |
\begin{tikzpicture} | |
\def\a{2} | |
\def\b{3} | |
\def\c{4} | |
\def\B{acos((\c^2+\a^2-\b^2)/(2*\a*\c))} | |
\def\r{\a*\c*sin(\B)/(\a+\b+\c)} | |
\coordinate (B) at (0,0); | |
\coordinate (C) at (\a,0); | |
\coordinate (A) at ({\B}:\c); | |
\coordinate (incenter) at (barycentric cs:A=\a,B=\b,C=\c); | |
\draw (A)--(B)--(C)--cycle; | |
\draw (incenter) circle[radius={\r}]; | |
\end{tikzpicture} | |
\end{document} | |
% | |
% Reference | |
% | |
% PGF Manual 139-140 | |
% https://pgf-tikz.github.io/pgf/pgfmanual.pdf | |
% (accessed 2021-06-05) | |
% | |
% GitHub - mebiolabo/EulerLine | |
% https://github.com/mebio-labo/EulerLine | |
% (accessed 2021-06-05) | |
% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment