Is there a way with TikZ to calculate the cross product of two vectors?
Here is my code:
\begin{tikzpicture}[scale=2]
\coordinate (ey) at (1,0,0);
\coordinate (ez) at (0,1,0);
\coordinate (ex) at (0,0,1);
\begin{scope}[x={(ex)},y={(ey)},z={(ez)}]
\def\xM{1.2}
\def\yM{1.6}
\def\zM{1.8}
\def\ech{2}
\coordinate (O) at (0,0,0);
\coordinate (X) at (\ech,0,0);
\coordinate (Y) at (0,\ech,0);
\coordinate (Z) at (0,0,\ech);
\coordinate (Pz) at (0,0,\zM);
\coordinate (M) at (\xM,\yM,\zM);
\coordinate (H) at (\xM,\yM,0);
\coordinate (V) at ($0.4(H)+0.48(Pz)$);
\coordinate (W) at ($0.4(H)$);
\coordinate (Vz) at ($0.48(Pz)$);
\coordinate (U) at ($0.33*(Pz)$);
\draw[->,thick] (0,0,0) -- (1,0,0) node[above left] {$\vec{\imath}$};
\draw[->,thick] (0,0,0) -- (0,1,0) node[below] {$\vec{\jmath}$};
\draw[->,thick] (0,0,0) -- (0,0,1) node[left] {$\vec{k}$};
\draw (O) -- (X);
\draw (O) -- (Y);
\draw (O) -- (Z);
\draw (O) -- (H);
\draw[very thick,->,blue] (O) -- (V) node[above right] {$\vec{v}$};
\draw[very thick,->,blue] (O) -- (W) node[below] {$\vec{w}$};
\draw[very thick,->,blue] (O) -- (U) node[left] {$\vec{u}$};
\draw (M) -- (H);
\draw (M) -- (Pz);
\draw[ultra thin] (V) -- (Vz);
\draw[ultra thin] (V) -- (W);
\path (O) node[left] {$O$};
\pgfmathsetmacro\angletheta{atan(\yM/\xM)} % rotation angle for OHM plane (theta)
\draw pic [rotate around z=\angletheta,canvas is xz plane at y=0,% draws in the OHM plane
draw,angle radius=0.75cm,
"$\theta$", % angle label (requires quotes library)
angle eccentricity=1.4 % angle position
] {angle = V--O--Z};
\draw[ultra thin] pic [draw,angle radius=0.2cm] {right angle = V--Vz--O};
\draw pic [canvas is xy plane at z=0,% draws in the xy plane
draw,->,angle radius=0.75cm,
"$\varphi$", % angle label (requires quotes library)
angle eccentricity=1.8 % angle position
] {angle = X--O--H};
\end{scope}
\end{tikzpicture}
So, now I would like to draw, in plane Oxy (and with the origin O), the vector n which is the cross product u x v.
How can I do that?


\angletheta±90– Juan Castaño Jun 11 '23 at 14:04