Graphics, Figures & Tables ⇒ coordinates
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
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
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
coordinates
Hi Kent,
welcome to the forum!
You could use
to store the values in these macros.
Stefan
welcome to the forum!
You could use
test
Code: Select all
\path (A);
\pgfgetlastxy{\xcoord}{\ycoord}
Stefan
LaTeX.org admin
Re: coordinates
Thanks for a quick reply indeed!
My PGF 2.0 don't find the command \pgfgetlastxy I am afraid.
My PGF 2.0 don't find the command \pgfgetlastxy I am afraid.
- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
Re: coordinates
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
Stefan
LaTeX.org admin
Re: coordinates
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
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
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
coordinates
You could try this way, by defining that macro (I think I read it in post by Andrew Stacey):
Then use it in a
Stefan
Code: Select all
\makeatletter
\newcommand{\getcoords}[3]{%
\tikz@scan@one@point\pgfutil@firstofone(#1)\relax
\edef#2{\the\pgf@x}%
\edef#3{\the\pgf@y}%
}
\makeatother
tikzpicture
environment such as:Code: Select all
\getcoords{A}{\xcoord}{\xcoord}
% just print the x and y values:
\node {\xcoord,\xcoord};
LaTeX.org admin
Re: coordinates
Stefan, it works! Great and thanks. I really appreciate it.
Kent
Kent