multivariate-statistics/figures/schemes/orthogonal_projection.tex

32 lines
1.3 KiB
TeX
Raw Normal View History

% ref. https://tex.stackexchange.com/a/523362/235607
\documentclass[tikz]{standalone}
\usepackage{tikz-3dplot}
\usepackage{tkz-euclide}
\usepackage{mathtools}
\begin{document}
\tdplotsetmaincoords{50}{0}
\begin{tikzpicture}[tdplot_main_coords,bullet/.style={circle,inner
sep=1pt,fill=black,fill opacity=1}]
\begin{scope}[canvas is xy plane at z=0]
\tkzDefPoints{-2/-1/A,3/-1/B,4/2/C}
\tkzDefParallelogram(A,B,C)
\tkzGetPoint{D}
\tkzDrawPolygon[fill=gray!25!white](A,B,C,D)
\draw[decorate,decoration={brace,
amplitude=8pt},xshift=0pt,very thin,gray] (2,0) -- ++(-1,-0.5) node [black,midway,xshift=0.5em,yshift=-1em] {\color{blue}$a$};
\end{scope}
\begin{scope}[canvas is xz plane at y=0]
\draw[thick,fill=white,fill opacity=0.7,nodes={opacity=1}]
(2,0) node[bullet,label=below right:{$\mathbf{X}$}] {}
-- (0,0) node[bullet] {}
-- (0,3) node[bullet,label=above:{$\mathbf{Y}$}] {} -- cycle;
\draw (0.25,0) -- (0.25,0.25) -- (0,0.25);
\draw[decorate,decoration={brace,
amplitude=8pt},xshift=0pt,very thin,gray] (0,0) -- (0,3) node [black,midway,xshift=-1.25em,yshift=0em] {\color{blue}$b$};
\end{scope}
\begin{scope}[canvas is xy plane at z=0]
\draw[->] (2,0) -- ++(-0.75,0.75) node [left] {$\mathbf{1}$};
\draw[->] (2,0) -- ++(-1,-0.5);
\end{scope}
\end{tikzpicture}
\end{document}