4

Let be given tetrahedron SABC, where AB= 3, AC=4, BC=5, SA= 6, SB=7,SC=8. I tried

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
    \tdplotsetmaincoords{60}{70}
    \begin{tikzpicture} [tdplot_main_coords,c/.style={circle,fill,inner sep=1pt}]
        \path
        (0,0,0) coordinate (A)
        (3,0,0)  coordinate (B)
        (0, 4,0) coordinate (C)
        ;
        \draw (C) -- (A) -- (B) -- cycle;
            \path foreach \p/\g in {A/180,B/0,C/90}{(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
    \end{tikzpicture}
\end{document}  

How to get the point S?

5
  • 1
    That is a math problem Oct 3, 2021 at 2:05
  • @John: I guess that you wants to construct the tetradhedron when knowing the lengths of six sides. If so, that is a classical Euclidean geometry problem, anh its solution (algorithm how to construct) is avaiable very long time ago. Do you need a reference for that?
    – Black Mild
    Oct 3, 2021 at 5:22
  • @BlackMild Yes can you show the link for me? And, How about Asymptote? Oct 3, 2021 at 6:04
  • 1
    @JohnPaulPeter: Have you checked that 3,4,5,6,7,8 are sides of a tetrahedron? Note that for a,b,c be 3 sides of a triangle, we need the triangle inequality a+b>c. There is a similar situation for tetrahedron, see this paper Edge lengths determining tetrahedrons ems-ph.org/journals/…
    – Black Mild
    Oct 3, 2021 at 9:51
  • @BlackMild Thank you very much. From the paper to latex, I see very difficult. Can you using your link to answer my question? Oct 3, 2021 at 10:53

3 Answers 3

4

Note that, there are two point S. I put them S and S'. You can use 3dtools. In this code, I add two points T and T' can be found by Maple to compare with the results of 3dtools.

\documentclass[border=2mm]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{3dtools,calc}% https://github.com/marmotghost/tikz-3dtools
    \begin{document}
        \begin{tikzpicture}[3d/install view={phi=70,theta=70},line cap=butt,line join=round,c/.style={circle,fill,inner sep=1pt},declare function={r1=6;r2=7;r3=8;}] 
            \path
            (0,0,0) coordinate (A)
            (3,0,0) coordinate (B)
            (0,4,0) coordinate (C)
            (-2/3,-3/2,{sqrt(1199)/6}) coordinate (T)
            (-2/3,-3/2,{-sqrt(1199)/6}) coordinate (T')
            ;  % T and T' are found by Maple
            \path[overlay,3d/aux keys/i1=S,3d/aux keys/i2=S',3d/intersection of three spheres={rA=r1,rB=r2,rC=r3}];
            \path foreach \p/\g in {A/180,B/-90,C/-90,S/0,T/180,S'/0,T'/180}
            {(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
            \end{tikzpicture}
    \end{document}   

enter image description here

3

This is a two steps approach, first using tkz-euclide to (graphically) obtain S point, and then a simply TikZ 3d drawing with the tetradhedron.

Fisrt step (tkz-euclide)

Here I'm finding the horizontal projection F of the point S, and the height of the tetradhedron FS. I'm using descriptive geometry, and specifically auxiliary inclined views.

The code:

\documentclass[border=2mm]{standalone}
\usepackage{tkz-euclide}

\begin{document}
\begin{tikzpicture}
% triangle ABC
\tkzDefPoint(0,0){A}
\tkzDefPoint(3,0){B}
\tkzInterCC[R](A,4cm)(B,5cm)
\tkzGetFirstPoint{C}
\tkzCompass[color=red,delta=10](A,C)
\tkzCompass[color=red,delta=10](B,C)
\tkzDrawPolygon(A,B,C)
% triangle ABS1
\tkzInterCC[R](A,6cm)(B,7cm)
\tkzGetSecondPoint{S1}
\tkzCompass[color=red,delta=10](A,S1)
\tkzCompass[color=red,delta=10](B,S1)
% triangle ACS2
\tkzInterCC[R](A,6cm)(C,8cm)
\tkzGetFirstPoint{S2}
\tkzCompass[color=red,delta=5](A,S2)
\tkzCompass[color=red,delta=5](B,S2)
\tkzDrawSegments[blue](B,S1 S1,A A,S2 S2,C)
% points D,E,F,G,H
\tkzDefPointBy[projection = onto A--B](S1)
\tkzGetPoint{D}
\tkzDrawLine[dashed,add= 2cm and 1cm](S1,D)
\tkzDefPointBy[projection = onto A--C](S2)
\tkzGetPoint{E}
\tkzDrawLine[dashed,add= 1cm and 1cm](S2,E)
\tkzInterLL(S1,D)(S2,E)
\tkzGetPoint{F}
\tkzInterLC(A,C)(E,S2)
\tkzGetFirstPoint{G}
\tkzInterLC(F,S1)(E,S2)
\tkzGetFirstPoint{H}
\tkzDrawLine[add=0 and 1cm](A,G)
\tkzDrawArc(E,S2)(G)
% draw right angles
\tkzMarkRightAngle(D,F,S2)
\tkzMarkRightAngle(A,E,S2)
% draw points
\tkzDrawPoints(A,B,C,E,S1,S2,F,G,H)
\tkzLabelPoints(A,B,C,E,F,G,H)
\tkzLabelPoint(S1){$S_1$}
\tkzLabelPoint(S2){$S_2$}
% lengths
\tkzGetPointCoord(F){f}
\tkzCalcLength[cm](F,H)\tkzGetLength{dFH}
\tkzLabelPoint(-5,5)  {$F(\pgfmathprint{\fx},\pgfmathprint{\fy})$}
\tkzLabelPoint(-5,4.5){$h=\overline{FH}=\pgfmathprint{\dFH}$}
\end{tikzpicture}
\end{document}

And the output: enter image description here

Second step (TikZ)

Now I have determined S, approximately (-2/3,-3/2,5.77083). So the rest is only choosing the view and placing the points:

\documentclass[border=2mm,tikz]{standalone}
\usetikzlibrary{3d} % not needed if we only draw the tetrahedron
\usetikzlibrary{perspective}

\begin{document}
\begin{tikzpicture}[3d view={30}{-25},line cap=round,line join=round]
% coordinates
\coordinate (A) at (0,0,0);
\coordinate (B) at (3,0,0);
\coordinate (C) at (0,4,0);
\coordinate (S) at (-2/3,-3/2,5.77083); % see above tkz-euclide code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% this is only for showing where is everything %
\begin{scope}[canvas is xy plane at z=0]
  \draw[gray] (-2,-2) grid (4,5);
\end{scope}
\coordinate (F) at (-2/3,-3/2,0);
\draw[blue,dashed] (F) -- (S);
\fill (F) circle (1pt) node [left]  {$F$};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% lines
\draw[blue,thick,dashed] (A) -- (B);
\draw[blue,thick] (C) -- (A) -- (S) -- (C) -- (B) -- (S);
% points
\fill (A) circle (1pt) node [left]  {$A$};
\fill (B) circle (1pt) node [right] {$B$};
\fill (C) circle (1pt) node [below] {$C$};
\fill (S) circle (1pt) node [above] {$S$};
\end{tikzpicture}
\end{document}

And the final output: enter image description here

2
  • nice grid! Could you explain more how you use descriptive geometry to calculate the foot F of the altitude SF ? I just guess it is a bit involving with origami way in Polya's book
    – Black Mild
    Oct 4, 2021 at 9:29
  • 1
    @BlackMild, I'm following this procedure: math.stackexchange.com/questions/632936/…. Take a look specifically at the second picture, which is what I'm drawing but with triangles instead of pentagons. All the triangles are easy to draw as we know the lengths. Oct 4, 2021 at 10:04
3

Update: The calculations are from the 3-D Cartesian true range multilateration (in fact, those are formulae for calculating intersections of three spheres). I also add the 3D grid on XY-plane.

enter image description here

unitsize(1cm);
import three;
import grid3;
triple barycentric(triple A, triple B, triple C, real a, real b, real c){return (a*A+b*B+c*C)/(a+b+c);}

currentprojection=orthographic((1,1,.8),center=true,zoom=.9);

// Step 1: construct the base A,B,C on the plane z=0
real a=5, b=4, c=3; 
triple B=(0,0,0), C=(a,0,0);
// Abc is the projection of A on the segment BC
triple Abc=barycentric(B,C,O,1/(a^2+c^2-b^2),1/(a^2+b^2-c^2),0);
real bt=abs(Abc-B);
real hbc=sqrt(c*c-bt*bt);
triple A=Abc+hbc*dir(90,90);
draw(A--B--C--cycle,blue+1pt);
label("$A$",A,plain.S);
label("$B$",B,dir(150));
label("$C$",C,plain.NW);
//label("$A_{bc}$",Abc,plain.N,red);
//draw(A--Abc,red);

// Step 2: get the top point D
real at=6, bt=7, ct=8; 
// H is the projection of D on the base ABC
// https://en.wikipedia.org/wiki/True-range_multilateration
real Hx=(bt^2-ct^2+a^2)/(2a);
real Hy=(bt^2-at^2+A.x^2+A.y^2-2A.x*Hx)/(2A.y);
real Dz=sqrt(bt^2-Hx^2-Hy^2);
triple H=(Hx,Hy,0);
triple D=(Hx,Hy,Dz);

draw(D--A^^D--B^^D--C,blue+1pt);
draw(D--H,red+dashed);
label("$D$",D,plain.N);
label("$H$",H,plain.E,red); dot(H,red);

// grid on XY-plane
limits((-2,-2,0),(7,5,0));
grid3(XYXgrid,step=1,.5gray+.5white);
draw(Label("$x$",EndPoint),O--8X,Arrow3());
draw(Label("$y$",EndPoint),O--6Y,Arrow3());
draw(Label("$z$",EndPoint),O--6Z,Arrow3());
write("H = ("+string(H.x)+","+string(H.y)+",0)");
write("DH = "+string(abs(H-D)));

enter image description here

Old answer This is a well-known construction problem of Euclidean geometry. In drawing, we can use geometric constructions, but it is better to use computation approaches. Among some computation approaches, I found one using barycentric coordinate is more convenient and can be applied for drawing both 2D and 3D figures.

Problem 1. Triangle on the plane: To construct a triangle ABC on the plane Oxy knowing its 3 lengths a=BC, b=CA, c=AB (provided that the triangle a + b > c is fulfilled)

The usual way is first taking B and C such that BC=a, then A is one of two intersection points of the circle centered B with radius c and the circle centered C with radius b, using some built-in procedures to find intersection of 2 circle path. Here I go with computation approach
using barycentric coordinate

pair barycentric(pair A=(0,0), pair B=(0,0), real a=1, real b=0){
return (a*A+b*B)/(a+b);}

Rewriting the formula in this my answer, to get the projection H of the A on BC

pair H=barycentric(B,C,1/(a^2+c^2-b^2),1/(a^2+b^2-c^2));

Finally, the point A is obtained by the Pythagorean theorem in the right triangle AHB.

enter image description here

// http://asymptote.ualberta.ca/
pair barycentric(pair A=(0,0), pair B=(0,0), real a=1, real b=0){
return (a*A+b*B)/(a+b);}

// Application: construct a triangle knowing the lengths of 3 sides
unitsize(1cm);
real a=6, b=5, c=2.5;
pair B=(0,0), C=(a,0);
pair H=barycentric(B,C,1/(a^2+c^2-b^2),1/(a^2+b^2-c^2));
real bt=abs(H-B);
real h=sqrt(c*c-bt*bt);
pair A=H+h*dir(90);

draw(box(H,H+(.2,.2)),red);
draw(A--H,red);
draw(A--B--C--cycle);
label("$A$",A,plain.N);
label("$B$",B,plain.SW);
label("$C$",C,plain.SE);
label("$H$",H,plain.S);

Problem 2. Triangle on the space: To construct a triangle ABC on the space Oxyz knowing its 3 lengths a=BC, b=CA, c=AB (provided that the triangle inequality a + b > c is fulfilled)

This can be done as same as Problem 1 with suitable minor changes (see Step 1 in the code of Problem 3 below).

Problem 3. Tetrahedron on the space: To construct a tetrahedron D.ABC on the space Oxyz knowing its 6 lengths (3 lengths of the base a=BC, b=CA, c=AB; and 3 remaining lengths at=DA, bt=DB, ct=DC (provided that some conditions are fulfilled, see this 2009 EMS paper).

We use barycentric coordinate 2 times. First construct triangle ABC on some plane, say z=0. This is the above Problem 2. Next, get the projection H of D on the base ABC. The Heron formula is used in the barycentric coordinates of H (areas are used instead of side lengths)

import three;
triple barycentric(triple A, triple B, triple C, real a, real b, real c){return (a*A+b*B+c*C)/(a+b+c);}

real Heron(real a, real b, real c){
real p=(a+b+c)/2;
return sqrt(p*(p-a)*(p-b)*(p-c));
}

then the desired point D is obtained by the Pythagoras theorem in the right triangle DHA.

enter image description here

Full code (still some mistake! I am looking for barycentric coordinates of the foot of an altitude in a tetrahedron - seems an interesting and sensitive situation)

unitsize(1cm);
import three;
triple barycentric(triple A, triple B, triple C, real a, real b, real c){return (a*A+b*B+c*C)/(a+b+c);}

real Heron(real a, real b, real c){
real p=(a+b+c)/2;
return sqrt(p*(p-a)*(p-b)*(p-c));
}
currentprojection=orthographic((1,1.6,1),center=true,zoom=.95);

// Step 1: construct the base A,B,C on the plane z=0
real a=6, b=5, c=4; 
triple B=(0,0,0), C=(a,0,0);
// Abc is the projection of A on the segment BC
triple Abc=barycentric(B,C,O,1/(a^2+c^2-b^2),1/(a^2+b^2-c^2),0);
real bt=abs(Abc-B);
real hbc=sqrt(c*c-bt*bt);
triple A=Abc+hbc*dir(90,90);

draw(A--Abc,red);
draw(A--B--C--cycle);
label("$A$",A,plain.S);
label("$B$",B,plain.E);
label("$C$",C,plain.W);
label("$A_{bc}$",Abc,plain.N,red);

// Step 2: get the top point D
real at=6, bt=7, ct=4; 
// H is the projection of D on the base ABC
real Sdab=Heron(at,bt,c);
real Sdbc=Heron(bt,ct,a);
real Sdca=Heron(ct,at,b);
triple H=barycentric(A,B,C,1/(Sdab^2+Sdca^2-Sdbc^2),1/(Sdab^2+Sdbc^2-Sdca^2),1/(Sdca^2+Sdbc^2-Sdab^2));
real ha=abs(H-A);
real hd=sqrt(at*at-ha*ha);
triple D=H+hd*Z;
draw(D--A^^D--B^^D--C);
draw(D--H,blue);
label("$D$",D,plain.N);
label("$H$",H,plain.W,blue); dot(H);

PS1: Why Asymptote and why not TikZ? That drawing way of using barycentric coordinate can be coded in several drawing languages. TikZ does has barycentric coordinate; but its computation is quite weak, Dimension too large error may happen, even in 2D when I had tried drawing the Euler line of a triangle)! Asymptote has better accuracy, and available for 3D.

PS2: There is another way based on origami, described in a book of Polya. I will do it in free time later.

6
  • You wrote "Full code (still some mistake ^^)" and " I will do it in free time later." When you post correct answer? Oct 6, 2021 at 0:38
  • Peter: As I said: "in free time later". There is a math formula in my last code that I am not sure. If you read my code, you will find that formula. By the way, even you have accepted an answer, I recommend you upvote @Juan Castano's nice TikZ answer; there is only one vote from me so far
    – Black Mild
    Oct 6, 2021 at 2:03
  • I do not understand you. You wrote "why not TikZ" and "@Juan Castano's nice TikZ answer". Oct 6, 2021 at 12:35
  • @Peter: Aha, tt's my subjective opinion, oriented to broad scope of many other figures. It does not conflict with my comment about some nice TikZ figure.
    – Black Mild
    Oct 6, 2021 at 14:07
  • 1
    Thank you very much. Oct 13, 2021 at 7:39

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.