4

Based on the answer How can I draw a 3D, three-sided 5-7-9 triangle with TikZ or PSTricks?, I tried with a=10;b=10;c=10or larger I got Dimension too large. My code.

\documentclass[12pt, border = 1mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
    \tdplotsetmaincoords{60}{60}
    \begin{tikzpicture}[tdplot_main_coords,scale=1,tdplot_main_coords,declare function={a=10;b=10;c=10;R= 1/2*sqrt((a + b - c)* (a - b + c) *(-a + b + c)/(a + b + c));%
    }]
\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 (I) at ({1/2 *(-a + b + c)}, 
{ 1/2*sqrt(((a + b - c)* (a - b + c)* (-a + b + c))/(a + b + c))});
    \draw[red,dashed,thick] (I) circle[radius= R];  
\foreach \p in {A,B,C,I}
\draw[fill=black] (\p) circle (1.5pt);
\foreach \p/\g in {A/180,C/0,B/-90}
\path (\p)+(\g:3mm) node{$\p$};
\draw[thick] (A) -- (B) -- (C) --cycle ;
\end{tikzpicture}
\end{document}
5

Just use fpu. I recommend using it locally, e.g. with

\begin{scope}[/pgf/fpu,/pgf/fpu/output format=fixed]
\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);
\end{scope}

since some path constructions do not work with fpu.

\documentclass[12pt, border = 1mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{fpu}
\begin{document}
\tdplotsetmaincoords{60}{60}
\begin{tikzpicture}[tdplot_main_coords,scale=1,tdplot_main_coords,declare function={a=10;b=10;c=10;R= 1/2*sqrt((a + b - c)* (a - b + c) *(-a + b + c)/(a + b + c));%
    }]
\coordinate (A) at (0,0,0);
\coordinate (B) at (c,0,0);
\begin{scope}[/pgf/fpu,/pgf/fpu/output format=fixed]
\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);
\end{scope}
\coordinate (I) at ({1/2 *(-a + b + c)}, 
{ 1/2*sqrt(((a + b - c)* (a - b + c)* (-a + b + c))/(a + b + c))});
    \draw[red,dashed,thick] (I) circle[radius= R];  
\foreach \p in {A,B,C,I}
\draw[fill=black] (\p) circle (1.5pt);
\foreach \p/\g in {A/180,C/0,B/-90}
\path (\p)+(\g:3mm) node{$\p$};
\draw[thick] (A) -- (B) -- (C) --cycle ;
\end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.