## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ coordinates Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm

### coordinates

I wonder how one easily can get from (A) defined by \cordinate (A) at ...
to the specific x and y coordinates of (A). I do not have the angle package available in PGF 3.0 or tkz-2d etc..
Kent Holing
NORWAY

Tags:

Stefan Kottwitz
Posts: 9561
Joined: Mon Mar 10, 2008 9:44 pm
Hi Kent,

welcome to the forum!

You could use

`test`

`\path (A);\pgfgetlastxy{\xcoord}{\ycoord}`

to store the values in these macros.

Stefan

kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm
Thanks for a quick reply indeed!
My PGF 2.0 don't find the command \pgfgetlastxy I am afraid.

Stefan Kottwitz
Posts: 9561
Joined: Mon Mar 10, 2008 9:44 pm
PGF 2.0 is very old, it's very recommendable to update. PGF 2.10 and 3.0 provide new features and libraries. I have no way to test something with the old 2.0.

Stefan

kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm
I appreciate your kind help Stefan.

Can anybody else out there have a solution of my problem using PGF 2.0?
If so, I would be delighted to hear about it.
Regards,
Kent

Stefan Kottwitz
Posts: 9561
Joined: Mon Mar 10, 2008 9:44 pm
You could try this way, by defining that macro (I think I read it in post by Andrew Stacey):

`\makeatletter\newcommand{\getcoords}[3]{%   \tikz@scan@one@point\pgfutil@firstofone(#1)\relax  \edef#2{\the\pgf@x}%  \edef#3{\the\pgf@y}%}\makeatother`

Then use it in a `tikzpicture` environment such as:

`\getcoords{A}{\xcoord}{\xcoord}% just print the x and y values:\node {\xcoord,\xcoord};`

Stefan