3차원 공간에서의 벡터 투영

3차원 공간에서의 벡터 투영

"P2"에서 벡터 "P"의 투영 "d"를 찾으려고 합니다.여기에 이미지 설명을 입력하세요, 어떤 도움이라도 주시면 감사하겠습니다.

\documentclass{article}
\usepackage{tikz}   %TikZ is required for this to work.  Make sure this exists before the next line

\usepackage{tikz-3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX installation
\usepackage[active,tightpage]{preview}  %generates a tightly fitting border around the work
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{2mm}
    \usepackage{xcolor}
    \definecolor{lava}{rgb}{0.81, 0.06, 0.13}
    \definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
    \usetikzlibrary{angles, arrows.meta, quotes}  
  \begin{document}
\tdplotsetmaincoords{60}{110}
\pgfmathsetmacro{\rvec}{.8}
\pgfmathsetmacro{\thetavec}{30}
\pgfmathsetmacro{\phivec}{80}


\begin{tikzpicture}[scale=5,tdplot_main_coords,ang/.style = {draw, Straight Barb-Straight Barb, anchor=west,angle radius = 8mm, angle eccentricity=1},arr/.style = {cap=round,-Straight Barb},]
\coordinate (O) at (0,0,0);
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}

\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};

 
\draw[-stealth,color=myblue] (O) -- (P);
\tdplotsetcoord{P2}{0.9}{60}{80}
\draw[-stealth,color=myblue] (O) -- (P2);
\tdplotsetcoord{P3}{0.6}{60}{80}
\pic [ang, "$\phi$"] {angle = P2--O--P};
\end{tikzpicture}

\end{document}

답변1

투영을 도출하기 위해 수학 공식을 사용할 수 있습니다.

P2에 P를 투영하여 얻은 벡터의 길이는 |P|cos(phi)입니다.

따라서 \tdplotsetcoord{P5}{0.4*sqrt(3)}{60}{80}(0.8*cos(60-30))은 P2의 투영점입니다.

\begin{tikzpicture}[scale=5,tdplot_main_coords,ang/.style = {draw, Straight Barb-Straight Barb, anchor=west,angle radius = 8mm, angle eccentricity=1},arr/.style = {cap=round,-Straight Barb},]
\coordinate (O) at (0,0,0);
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}

\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};

 
\draw[-stealth,color=myblue] (O) -- (P);
\tdplotsetcoord{P2}{0.9}{60}{80}
\draw[-stealth,color=myblue] (O) -- (P2);
\tdplotsetcoord{P3}{0.6}{60}{80}
\pic [ang, "$\phi$"] {angle = P2--O--P};

\tdplotsetcoord{P5}{0.4*sqrt(3)}{60}{80}
\draw[-stealth,color=red, dashed] (O) -- (P5);
\end{tikzpicture}

여기에 이미지 설명을 입력하세요

관련 정보