TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to get the x or y coordinate of a Point with tkz? Especially if I have two points A=(a_1,a_2) and B=(b_1,b_2) I want to have a Point C=(a_1,b_2).

This is related to Extract the x/y part from a coordinate in pgfplots. The difference is that I am asking for a way to to it in tkz.

share|improve this question
TkZ points are just coordinate nodes. So you can use exactly the same solution. – Caramdir May 24 '11 at 18:31
Thanks, but I don't get it, how to apply this exactly to my example above? – student May 24 '11 at 18:52
Side remark: Direct coordinate calculations seem to be against the spirit of tkz-euclide (hence the name). Maybe \tkzDefPointBy can do what you want. – Caramdir May 24 '11 at 19:22
up vote 4 down vote accepted

TkZ points are just coordinate nodes. As such you can use and define them in the same way. For example:



    \path let \p1=(A), \p2=(B) in (\x1,\y2) node[coordinate] (C) {};
share|improve this answer
Ye we can do that but I prefer to avoid the mix of syntaxes. I think it's preferable to create a new macro but this is possible ... – Alain Matthes May 24 '11 at 21:08

You can use the tikz possibilities, don't forget that you can use tikz and pgf at the same time with tkz. Another possibility is to use (the next macro is in tkz)


For example but I don't test it :

\path[coordinate](\pgf@xa,\pgf@yb) coordinate (#3);}

or more in the spirit of tkz

\path[coordinate](\pgf@xa,\pgf@yb) coordinate (tkzPointResult);}

You can use the point with :

share|improve this answer
Perhaps you can make something easier with some tikz macros – Alain Matthes May 24 '11 at 19:19
Do you know why \draw let \p1=(A), \p2=(B) in \pgfextra{\tkzDefPoint(\x1,\y2){C}}; doesn't work? (It results in FP error: Illegal character p found in float number!) – Caramdir May 24 '11 at 19:26
this is simple : \x1 and \y2 are lengths with pt or \tkzDefPoint uses numbers without units (by defaut the macro accepts only cm) so you need to remove pt – Alain Matthes May 24 '11 at 20:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.