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

Based on the answer given here, ($(A)!1cm!(B)$) in TikZ is equivalent to ([nodesep=1]{B}A) in PSTricks. It is just about the "radial" distance specified by two points. How about the "transverse" distance specified by two points?

More precisely, in PSTricks, the syntax ([offset=2]{A}B) represents a new point (namely C) which is 2 unit apart from the line joining A and B such that BC is perpendicular to AB.


enter image description here

What is the TikZ equivalent for such a syntax?


([offset=2]{A}B) can also be written as ([nodesep=2,angle=90]{A}B). Other approaches are also possible with, for example, transformations provided by pst-eucl.

share|improve this question
up vote 8 down vote accepted

The equivalent syntax is ($(B)!2cm!90:(A)$), which is the point 2cm away from B on the line from B to A after that line has been rotated by 90 degrees.



\coordinate (A) at (1,1);
\coordinate (B) at (4,4);

\coordinate (C) at ($(B)!2cm!90:(A)$);
\node at (A) [above] {A};
\node at (B) [above] {B};
\node at (C) [above] {C};

\fill (A) circle [radius=2pt] (B) circle [radius=2pt] (C) circle [radius=2pt];
share|improve this answer

With tkz-euclide package, using syntax \tkzDefPointWith[orthogonal normed, K=2](B,A) \tkzGetPoint {C} define a point C from B perpendicular to AB with 2cm length.



 \tkzDefPoints{0/0/O, 5/5/K}
  \tkzDefPoints{1/1/A, 4/4/B}  
  \tkzDefPointWith[orthogonal normed, K=2](B,A) \tkzGetPoint {C}   
  \tkzDrawLine[color=blue,add=0 and 0](B,tkzPointResult)


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.