2

I found a strange problem in my tikz picture. I use calc library to draw a line, and rotate this line with some angle, but I find I cannot specify its rotate center point. In other words, the rotation seems has no relationships with the center point I specified.

A minimal example is as follows:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
  \draw [step=.5,help lines] (-3,-3) grid (3,3);
  \node [fill=black, circle, minimum size=0.05, label=-30:$O$] at (0,0 {};
  \coordinate (r5) at (1,1);
  \draw [fill=yellow] ($(r5)+(1,0)$) circle (0.05);
  \draw [fill=yellow] ($(r5)+(1,2)$) circle (0.05);
  \draw [fill=yellow] ($(r5)+(1,1)$) circle (0.05);
  \draw [rotate around={90:($(r5)+(1,1)$)}, red, thick] ($(r5)+(1,0)$) -- ($(r5)+(1,2)$);
\end{tikzpicture}
\end{document}

As my understanding, the code rotate a line with its center point. In other words, the line constructed with the three yellow point should rotate around the middle point. But actually the effect is as follows: the out put of the codes

So, can you give me some help? Thanks for advance!

chunhui
  • 75
  • roughly, references to named coordinates, nodes on a path specification don't get effected by the transformation. – percusse Jul 02 '15 at 07:22
  • also related http://tex.stackexchange.com/questions/174082/understanding-tikz-inheritance-with-the-positioning-library and http://tex.stackexchange.com/questions/95030/why-such-rotate-in-tikz-doesnt-work – percusse Jul 02 '15 at 07:25
  • Hey! next time don't edit in the answer, but use the answer part below – Universal Electricity Jul 02 '15 at 13:15

0 Answers0