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

I have several coordinate specified in TikZ, say

\coordinate (a) at (0.4, 1.7);
\coordinate (b) at (3.2, 1.7);
\coordinate (c) at (1.7, 4.7);
\coordinate (cog) at ($1/3*(a) + 1/3*(b) + 1/3*(c)$);

Now I'm trying to use the (cog) coordinate in PGF commands, for example:

\pgftransformshift{<the (cog) coordinate>}

I already tried putting in (cog) or cog but it doesn't work as desired. So my question is: How do I convert my coordinate specified in TikZ so that I can use it inside PGF commands?

share|improve this question
up vote 9 down vote accepted

Coordinates also have anchors (well, only center anchor) and that can be used for referencing.

\draw[style=help lines] (0,0) grid[step=1cm] (5,5);
\coordinate (a) at (0.4, 1.7);
\coordinate (b) at (3.2, 1.7);
\coordinate (c) at (1.7, 4.7);
\coordinate (cog) at ($1/3*(a) + 1/3*(b) + 1/3*(c)$);
\draw (0,0) -- (2,2);

enter image description here

share|improve this answer

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.