Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[margin=5pt, tikz]{standalone}
- usepackage{tikz}
- usetikzlibrary{calc}
- usetikzlibrary{angles, quotes, babel}
- usepackage{amsmath, amssymb}
- begin{document}
- begin{tikzpicture}[x=1cm, y=1cm, z={(4mm,3mm)}, scale=1.5, font=small]
- pgfmathsetmacroa{2}
- pgfmathsetmacrob{2.5}
- pgfmathsetmacroc{3}
- pgfmathsetmacro{r}{0.5*sqrt(a^2+b^2+c^2)} %
- pgfmathsetmacro{AC}{sqrt(a^2+b^2)} %
- pgfmathsetmacro{PA}{0.5*AC} %
- pgfmathsetmacro{h}{sqrt(r^2-PA^2)} %
- % Pyramid
- draw (0,0,0) coordinate[label=below:$A$] (A)
- --(a,0,0) node[midway, below]{$a$} coordinate[label=below:$B$] (B)
- --(a,0,b) node[midway,right=2mm]{$b$} coordinate[label=$C$] (C);
- draw[densely dashed] (C)--(0,0,b) coordinate[label=left:$D$] (D)--(A);
- draw (A)--(0,c,0) node[midway, left]{$c$} coordinate[label=$S$] (S);
- % Diagonals
- draw (A)--(C);
- draw ($(A)!0.5!(C)$) coordinate coordinate[label=below:$P$] (P) -- ($(S)!0.5!(C)$) node[midway, left]{$h$} coordinate[label=$M$] (M);
- draw (D)--(B);
- % Point M
- draw (S)--(M) node[midway, above]{$r$} -- (C) node[midway, above]{$r$};
- draw[densely dashed] (D) -- (M);
- foreach P in {A,B,C} draw (M) -- (P);
- node[anchor=north west, align=left, yshift=-7mm] at (A){$begin{array}{l}
- a = a ,~ b = b,~ c = c \
- |AC| = sqrt{a^2+b^2} = AC \
- |PA| = 0.5 |AC| = PA \
- h = sqrt{r^2- |PA|^2} = h \
- r = 0.5 sqrt{a^2+b^2+c^2} = r
- end{array}$
- };
- shade[ball color = gray!40, opacity = 0.4] (M) circle[radius=5mm] node{?};
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement