# [Tex/LaTex] Extract coordinates from 3D point

3dcalculationspathstikz-pgf

How do I extract coordinates from a three-dimensional point defined when using tikz-3dplot? I would like to perform some calculations on these (more specifically a cross-product of two vectors), but it seemed to be stumped on the \z1 coordinate (Undefined control sequence), as illustrated with the following example:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{tikz-3dplot}
\begin{document}
\begin{figure}
\tdplotsetmaincoords{0}{0}
\begin{tikzpicture}[tdplot_main_coords]
\coordinate (A) at (1,2,3);
\path let \p1=(A) in (\z1,\y1,\x1) coordinate (B);
\end{tikzpicture}
\end{figure}
\end{document}


When TikZ reads in a coordinate specification, it converts it straight-away to its internal standard form. This means that it does not remember anything about how that coordinate was specified. (The only time that I know of where this is not strictly true is with the end point of a to path where the end coordinate is passed as-is to the to path construction). In particular, when TikZ encounters a coordinate of the form (1,2,3) then it converts it there and then to 1*x-vector + 2*y-vector + 3*z-vector. When TikZ/PGF remembers a node's position, it remembers just the resulting. So what you are asking for is not possible with ordinary TikZ/PGF.
Unfortunately, it certainly isn't advanced enough to work with the let syntax. So it wouldn't completely fit your requirements.