proyección vectorial en el espacio tridimensional

proyección vectorial en el espacio tridimensional

Estoy intentando encontrar la proyección "d" del vector "P" en "P2"ingrese la descripción de la imagen aquí, Cualquier ayuda sería apreciada.

\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}

Respuesta1

Se pueden utilizar fórmulas matemáticas para derivar la proyección.

La longitud del vector obtenida por proyección de P sobre P2 es |P|cos(phi).

Entonces \tdplotsetcoord{P5}{0.4*sqrt(3)}{60}{80}(0.8*cos(60-30)) es el punto proyectado en 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}

ingrese la descripción de la imagen aquí

información relacionada