First way The coordinates of the point N
is coordinate (N) at ({2*\h*\h*\a/(\a*\a + 2*\h*\h)}, 0,{\a*\a*\h/(\a*\a + 2*\h*\h)} )
\documentclass[border=3mm,12pt,tikz]{standalone}
\usepackage{fouriernc}
\usepackage{tikz,tikz-3dplot}
\tikzset{projection of point/.style args={(#1,#2,#3) on line through (#4,#5,#6)
and (#7,#8,#9)}{%
/utils/exec=\pgfmathsetmacro{\myprefactor}{((#1-#4)*(#7-#4)+(#2-#5)*(#8-#5)+(#3-#6)*(#9-#6))/((#7-#4)*(#7-#4)+(#8-#5)*(#8-#5)+(#9-#6)*(#9-#6))},
insert path={%
({#4+\myprefactor*(#7-#4)},{#5+\myprefactor*(#8-#5)},{#6+\myprefactor*(#9-#6)})}
}}
\begin{document}
\tdplotsetmaincoords{60}{70}
\begin{tikzpicture}[tdplot_main_coords]
\pgfmathsetmacro\a{4}
\pgfmathsetmacro\h{5}
\path
coordinate(O) at (0,0,0)
coordinate (A) at (\a,0,0)
coordinate (B) at (\a/2,{\a*sqrt(3)/2},0)
coordinate (S) at (0,0,\h)
coordinate (N) at ({2*\h*\h*\a/(\a*\a + 2*\h*\h)}, 0,{\a*\a*\h/(\a*\a + 2*\h*\h)} )
;
\path[projection of point={(0,0,0) on line through (\a/2,{\a*sqrt(3)/2},0) and (0,0,\h)}]
coordinate (M);
\draw (S) -- (O) -- (A) -- (B) -- cycle (S) -- (A);
\draw[dashed] (O) -- (B) (O) -- (M);
\foreach \point/\position in {A/below,B/right,O/below,S/above,M/above,N/left}
{\fill (\point) circle (1.5pt);
\node[\position=1.5pt] at (\point) {$\point$};
}
\end{tikzpicture}
\end{document}

Second way
Calculate coordinates of two points M
, N
with Maple.
\documentclass[border=3mm,12pt,tikz]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{70}
\begin{tikzpicture}[tdplot_main_coords]
\pgfmathsetmacro\a{4}
\pgfmathsetmacro\h{5}
\path
coordinate(O) at (0,0,0)
coordinate (A) at (\a,0,0)
coordinate (B) at (\a/2,{\a*sqrt(3)/2},0)
coordinate (S) at (0,0,\h)
coordinate (N) at ({2*\h*\h*\a/(\a*\a + 2*\h*\h)}, 0,{\a*\a*\h/(\a*\a + 2*\h*\h)} )
coordinate (M) at ({\h*\h*\a/(2*\a*\a + 2*\h*\h)}, {\h*\h*\a*sqrt(3)/(2*\a*\a + 2*\h*\h)},{\a*\a*\h/(\a*\a + \h*\h)} )
;
\draw (S) -- (O) -- (A) -- (B) -- cycle (S) -- (A);
\draw[dashed] (O) -- (B) (O) -- (M);
\foreach \point/\position in {A/below,B/right,O/below,S/above,N/right,M/right}
{\fill (\point) circle (1.5pt);
\node[\position=1.5pt] at (\point) {$\point$};
}
\end{tikzpicture}
\end{document}
Third way Use 3dtool
The plane passing through the point O
and perpendicular to the line SB
take vector SB
as normal vector. And then, you find two points M
and N
.
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{3dtools,calc}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
3d/install view={phi=70,theta=65},declare function={a=4;h=5;}]
\path
(0,0,0) coordinate (O)
(a,0,0) coordinate (A)
(a/2,{a*sqrt(3)/2},0) coordinate (B)
(0,0,h) coordinate (S)
[3d coordinate={(n)=(S)-(B)}]
;
\path[3d/plane with normal={(n) through (O) named p},
3d/line through={(S) and (A) named lSA},
3d/line through={(S) and (B) named lSB}];
\path[3d/intersection of={lSA with p}] coordinate (N);
\path[3d/intersection of={lSB with p}] coordinate (M);
\draw[3d/visible] (S) -- (O) -- (A) -- (B)--cycle (S) -- (A);
\draw[3d/hidden] (O) -- (B) (O) -- (M);
\path foreach \p/\g in {S/90,A/-90,B/-90,O/-90,M/0,N/180}
{(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
\end{tikzpicture}
\end{document}

Or you can try
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{3dtools,calc}
\begin{document}
\foreach \Angle in {5,10,...,355}
{\begin{tikzpicture}[line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
3d/install view={phi=\Angle,theta=65},declare function={a=4;h=5;},same bounding box=A]
\path
(0,0,0) coordinate (O)
(a,0,0) coordinate (A)
(a/2,{a*sqrt(3)/2},0) coordinate (B)
(0,0,h) coordinate (S)
[3d coordinate={(n)=(S)-(B)}]
;
\path[3d/plane with normal={(n) through (O) named p},
3d/line through={(S) and (A) named lSA},
3d/line through={(S) and (B) named lSB}];
\path[3d/intersection of={lSA with p}] coordinate (N);
\path[3d/intersection of={lSB with p}] coordinate (M);
\pgfmathsetmacro{\mybarycenter}{barycenter("(S),(O),(B),(A)")}
\path (\mybarycenter) coordinate (I);
\tikzset{3d/polyhedron/.cd,O={(I)},fore/.append style={fill=none},
back/.append style={3d/hidden},
draw face with corners={{(S)},{(O)},{(N)}},
draw face with corners={{(O)},{(A)},{(N)}},
draw face with corners={{(S)},{(M)},{(N)}},
draw face with corners={{(A)},{(B)},{(M)},{(N)}},
draw face with corners={{(A)},{(B)},{(O)}},
draw face with corners={{(S)},{(M)},{(O)}},
draw face with corners={{(B)},{(M)},{(O)}}}
\path foreach \p/\g in {S/90,A/-90,B/-90,O/-90,M/0,N/180}
{(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
\end{tikzpicture}}
\end{document}

One way to draw the point N
Let E
be midpoint of segment OB
; I
is intersection of two lines SE
and OM
, then IN
parallel to AE
.
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{3dtools,calc}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
3d/install view={phi=75,theta=65},declare function={a=4;h=5;}]
\path
(0,0,0) coordinate (O)
(a,0,0) coordinate (A)
(a/2,{a*sqrt(3)/2},0) coordinate (B)
(0,0,h) coordinate (S)
[3d coordinate={(E)=0.5*(O)+0.5*(B) }];
\path[
3d/line through={(S) and (A) named lSA},
3d/line through={(S) and (B) named lSB},
3d/line through={(S) and (E) named lSE}];
\path [3d/project={(O) on lSB}] coordinate (M);
\path [3d/line through={(O) and (M) named lOM}];
\path[3d/intersection of={lOM with lSE}] coordinate (I);
\path[3d/line with direction={(A) - (E) through (I) named lIN}];
\path[3d/intersection of={lIN with lSA}] coordinate (N);
\draw[3d/visible] (S) --(O) -- (A) -- (B) --cycle (S) -- (A) (O) -- (N) -- (M);
\draw[3d/hidden] (O) -- (B) (O) -- (M) (S) -- (E) (A) -- (E) (I) -- (N);
\path foreach \p/\g in {S/90,A/-90,B/-90,O/-150,M/60,E/-90,I/180,N/-30}
{(\p)node[c]{}+(\g:2.5mm) node{$\p$}};
\end{tikzpicture}
\end{document}
