Can I define a coordinate relative to an already defined coordinate? If I define a coordinate (A) with

\coordinate (A) at (2,0);

Is there a way to define a coordinate (B) that is 2cm to the left and one 1cm to the top of (A)? I am looking for something like:

\coordinate (B) at (A+(2cm,1cm));

Thank you!

share|improve this question

with calc library, you can add coordinates

\usetikzlibrary{calc} % in the preamble
...
\coordinate (B) at ($(A)+(2cm,1cm)$);

or with positioning library

\usetikzlibrary{positioning} % in the preamble
...
\coordinate[above right=1cm and 2cm of A] (B);
share|improve this answer
3  
or with a shift: \coordinate (B) at ([shift={(2cm,1cm)}]A); – Ignasi 4 hours ago
1  
or \path (A) ++(2cm,1cm) coordinate (B);. – Paul Gaborit 4 hours ago

Your Answer

 
discard

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.