I use this code to draw triangle. When I choose a = b = c = 5
, I got the result.
\documentclass[12pt, border = 1mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{intersections,calc,backgrounds}
\begin{document}
\tdplotsetmaincoords{70}{80}
\begin{tikzpicture}[tdplot_main_coords,line join = round, line cap = round]
\pgfmathsetmacro{\a}{5}
\pgfmathsetmacro{\b}{5}
\pgfmathsetmacro{\c}{5}
\pgfmathsetmacro\myr{{sqrt(- pow(\a,2) *pow(\b,2)* pow(\c,2)/(pow(\a,4) + pow(\b,4) + pow(\c,4)- 2 *pow(\a,2) *pow(\b,2) - 2*pow(\c,2) *pow(\b,2)-2*pow(\c,2) *pow(\a,2) ))}}
\coordinate (A) at (0,0,0);
\coordinate (B) at (\c,0,0);
\coordinate (C) at ({(pow(\b,2) + pow(\c,2) - pow(\a,2))/(2*\c)},{sqrt((\a+\b-\c) *(\a-\b+\c) *(-\a+\b+\c)* (\a+\b+\c))/(2*\c)},0);
\coordinate (T) at (\c/2, {\c* (\a*\a + \b*\b - \c*\c)/(2*sqrt((\a+\b-\c) *(\a-\b+\c)* (-\a+\b+\c)* (\a+\b+\c)))},0);
\foreach \point/\position in {A/left,B/below,C/above,T/below}
{
\fill (\point) circle (1.8pt);
\node[\position=3pt] at (\point) {$\point$};
}
\begin{scope}[canvas is xy plane at z=0]
\draw[thick] (T) circle (\myr);
\end{scope}
\end{tikzpicture}
\end{document}
If I use a = b = c = 6
or larger, I cannot obtain the result. How can I get the result?
pgfplots
. Please make a minimum example that contains only the necessary packages. – AndréC Aug 11 '19 at 15:42pow(\a,2)
etc instead of\a*\a
. – John Kormylo Aug 11 '19 at 15:54\a*\a*\a*\a
BTW, one should expand the polynomial$ax^2+bx+c$
as(a*x+b)*x+c
. It is both faster and more accurate (roundoff). – John Kormylo Aug 11 '19 at 16:04