Code: Select all
\begin{tikzpicture}
\coordinate (A) at (2.34, 3.21);
\pgfmathsetmacro{\Ax}{ "x-component of coordinate (A)" }
\Ax
\end{tikzpicture}
I would like to get this information since I am developing a LaTeX tool to perform vector math, and thought it would be convenient to specify vectors using the TikZ coordinate system. I essentially need to find a way to bridge the gap between specifying coordinates and defining macros that work within \pgfmathparse commands.
I have looked into the "let" operation that will pick out the x- and y-component of a coordinate as \x# and \y# macros, but there are several problems with this. First, it contains the "pt" unit, and this value will only exist within a \path or \draw operation. I can use this value to define another coordinate, but then I'm back where I started. Finally, there is no macro for the z-component.
Any suggestions or ideas are welcome!
Jeff