2

Based on This paper, I have a Heronian Tetrahedra Are Lattice Tetrahedra with vertices O(0, 0, 0), A(15, -60, 20), B(96, 120, 128), C(63, 84, 56) and
based on This answer I tried

\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= 5*sqrt(451369)/14;%
    }] 
    \path 
    coordinate (O) at (0, 0, 0) 
    coordinate (A) at (15, -60, 20) 
    coordinate (B) at (96, 120, 128)
    coordinate (C) at (63, 84, 56)
    coordinate (I) at   (-1383/14, 90/7, 1528/7)
    ; 
    \begin{scope}[tdplot_screen_coords]
    \draw[thick] (I) circle (R);
    \end{scope}
    \end{tikzpicture} 
\end{document}

I can't obtain the result because the Dimension is too large. Without calculating coordinates of center and radius of sphere, how can I draw the sphere passing through O, A, B, C?

tinlyx
  • 153

2 Answers2

1

I just used a hand calculator.

\documentclass[tikz,border=2 mm,12pt]{standalone}
\usepackage{tikz-3dplot}
\begin{document} 
    \tdplotsetmaincoords{75}{170} 
    \begin{tikzpicture}[scale=1/10,line cap=butt,line join=round,tdplot_main_coords] 
    \path 
    coordinate (O) at (0, 0, 0) 
    coordinate (A) at (15, -60, 20) 
    coordinate (B) at (96, 120, 128)
    coordinate (C) at (63, 84, 56)
    coordinate (I) at (-98.79, 12.86, 218.29)
    ; 
    \begin{scope}[tdplot_screen_coords]
    \draw[thick] (I) circle (239.94);
    \end{scope}
    ; 
    \draw[thick] (O)--(A) (O)--(B) (O)--(C) (A)--(B) (A)--(C) (B)--(C);
    \end{tikzpicture} 
\end{document}

demo

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
0

If your question is how to remove the dimension too large error, one possible answer is: with fpu.

\documentclass[tikz,border=2 mm,12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tikz-3dplot-circleofsphere}
\usetikzlibrary{fpu}
\def\pgfmathsetmacroFPU#1#2{\begingroup%
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro{#1}{#2}%
\pgfmathsmuggle#1\endgroup}%

\begin{document} 
    \tdplotsetmaincoords{75}{170} 
    \begin{tikzpicture}[scale=1/10,line cap=butt,line join=round,tdplot_main_coords,
        %declare function={R= 5*sqrt(451369/(14*14));%  }
        ] 
    \pgfmathsetmacroFPU{\myR}{5*sqrt(451369)/14}
    \path 
    coordinate (O) at (0, 0, 0) 
    coordinate (A) at (15, -60, 20) 
    coordinate (B) at (96, 120, 128)
    coordinate (C) at (63, 84, 56)
    coordinate (I) at   (-1383/14, 90/7, 1528/7)
    ; 
    \begin{scope}[tdplot_screen_coords]
     \draw[thick] (I) circle[radius=\myR];
    \end{scope}
    \end{tikzpicture} 
\end{document}
  • I do not think you can obtain the center and the radius without any computations, but of course you could let LaTeX do the math. –  Dec 01 '19 at 08:16
  • for me, he (she) wants to ask "Without calculating coordinates of center and radius of sphere, how can I draw the sphere passing throught O, A, B, C?" in LaTeX. I think, this is a difficult question. – minhthien_2016 Dec 01 '19 at 08:22
  • @minhthien_2016 Thanks! I do not think it is too difficult (but it is very late here). 3dtools has the the circle through 3 points in, and stores the center. So we can construct two of them and can construct the normals through the centers. Where they meet will be the center of the sphere. –  Dec 01 '19 at 08:30
  • @Schrödinger'scat - Alternatively, construct planes from perpendicular bisectors to 3 of the edges. Where the three planes intersect is the center. OTOH, I have no idea how to do that using tikz. – John Kormylo Dec 01 '19 at 16:53
  • @JohnKormylo Yes, I agree with that. The problem with computing the intersection of planes, though, is that you need to distinguish quite a few cases since some coefficients can be 0. –  Dec 01 '19 at 16:56
  • @minhthien_2016 I am not currently working on that. –  Dec 07 '19 at 04:44