# How can I repair Dimension too large of the point S in this code?

I am trying to draw Heronian Tetrahedron at http://mathworld.wolfram.com/HeronianTetrahedron.html. I cannot get the exact results with the message "Dimension too large" of the point S. How can I get the correct result?

\documentclass[tikz,border=2 mm,12pt]{standalone}
\usepackage{tikz-3dplot-circleofsphere}
\begin{document}
\tdplotsetmaincoords{75}{150}
\begin{tikzpicture}[scale=1/10,line cap=butt,line join=round,tdplot_main_coords,declare function={R= 17*sqrt(7801)*(1/18);r=689/10;
Angle=acos(r/R);%
}]
\path
coordinate (A) at (-117/2, 182/5, 2116/45)
coordinate (B) at (117/2, 182/5, 2116/45)
coordinate (C) at (399/26, 4366/65, 2116/45)
coordinate (S) at (495/26, 8134/325, 17384/225)
coordinate (O) at   (0,0,0)
coordinate (T)  at (0,0, 2116/45)
coordinate (D) at (-117/2, -182/5, 2116/45);
\begin{scope}[tdplot_screen_coords]
\draw[thick] (O) circle (R);
\end{scope}
\begin{scope}
\tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{Angle}}
\tdplotCsDrawLonCircle[tdplotCsFront/.style={thick}]{R}{atan(-45/28)}
\end{scope}
\foreach \p in {A,B,C,S,O,T,D}
\draw[fill=black] (\p) circle (15 pt);
\foreach \p/\g in {A/-90,B/45,C/-90,S/150,O/90,T/0,D/60}
\path (\p)+(\g:30mm) node{$\p$};
\foreach \X in {A,B,C} \draw[dashed] (\X) -- (S);
\draw[dashed] (A) -- (B) -- (C) --  cycle (A) -- (C) ;
\end{tikzpicture}
\end{document}


The fix is very simple. TeX is complaining about the fraction 17384/225 and didn't like the numerator. All I did was to replace this fraction by 173.84/2.25.

\documentclass[tikz,border=2 mm,12pt]{standalone}
\usepackage{tikz-3dplot-circleofsphere}
\begin{document}
\tdplotsetmaincoords{75}{150}
\begin{tikzpicture}[scale=1/10,line cap=butt,line join=round,tdplot_main_coords,declare function={R= 17*sqrt(7801)*(1/18);r=689/10;
Angle=acos(r/R);%
}]
\path
coordinate (A) at (-117/2, 182/5, 2116/45)
coordinate (B) at (117/2, 182/5, 2116/45)
coordinate (C) at (399/26, 4366/65, 2116/45)
coordinate (S) at (495/26, 8134/325, 173.84/2.25)
coordinate (O) at   (0,0,0)
coordinate (T)  at (0,0, 2116/45)
coordinate (D) at (-117/2, -182/5, 2116/45);
\begin{scope}[tdplot_screen_coords]
\draw[thick] (O) circle (R);
\end{scope}
\begin{scope}
\tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{Angle}}
\tdplotCsDrawLonCircle[tdplotCsFront/.style={thick}]{R}{atan(-45/28)}
\end{scope}
\foreach \p in {A,B,C,S,O,T,D}
\draw[fill=black] (\p) circle (15 pt);
\foreach \p/\g in {A/-90,B/45,C/-90,S/150,O/90,T/0,D/60}
\path (\p)+(\g:30mm) node{$\p$};
\foreach \X in {A,B,C} \draw[dashed] (\X) -- (S);
\draw[dashed] (A) -- (B) -- (C) --  cycle (A) -- (C) ;
\end{tikzpicture}
\end{document}


This code get correct result and doesn't get message "Dimension too large".

\documentclass[tikz,border=2 mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz-3dplot-circleofsphere}
\begin{document}
\tdplotsetmaincoords{75}{170}
\begin{tikzpicture}[scale=1/10,line cap=butt,line join=round,tdplot_main_coords,declare function={R= 17*sqrt(7801)*(1/18);r=689/10;
Angle=acos(r/R);%
}]
\path
coordinate (A) at (0, 0, 0)
coordinate (B) at (117, 0, 0)
coordinate (C) at (960/13, 400/13, 0)
coordinate (S) at (1008/13, -3696/325, 756/25)
coordinate (O) at   (117/2, -182/5, -2116/45)
coordinate (T)  at (117/2, -182/5,0) ;
\begin{scope}[tdplot_screen_coords]
\draw[thick] (O) circle (R);
\end{scope}
\begin{scope}[shift={(O)}]
\tdplotCsDrawLatCircle[tdplotCsFront/.style={thick}]{R}{{Angle}}
\end{scope}
\foreach \p in {A,B,C,S,O,T}
\draw[fill=black] (\p) circle (15 pt);
\foreach \p/\g in {A/-90,B/-90,C/-90,S/150,O/90,T/0}
\path (\p)+(\g:30mm) node{$\p$};
\foreach \X in {A,B,C} \draw[dashed] (\X) -- (S);
\draw[dashed] (A) -- (B) -- (C) --  cycle (A) -- (C) ;
\end{tikzpicture}
\end{document}