I have a circle in the picture... How to add dimension of radius... form center of the circle to any point on the circle? Rotation is not giving what i want...




\draw [step=1.0,thin,gray!40] (0,-3) grid (6,3);

\fill[blue] (3,0) circle (2pt) node [black,,below left] {$C$};
\draw[thick] (3,0) circle(3);

\draw[|->|] (3,0) -- (6,0)  node [midway,fill=white] {3$a$};
\draw[|->|,rotate=45] (3,0) -- (6,0)  node [midway,fill=white] {3$a$};


  • 1
    Is rotate around={45:(3,0)} instead of rotate=45 what you want? – Qrrbrbirlbel Jan 2 '13 at 5:52
  • @Qrrbrbirlbel Yes it works... but text is always horizontal now... – sandu Jan 2 '13 at 6:10
  • Qrrbrbirlbel: It works...Thanks... I added in Answer 2 – sandu Jan 2 '13 at 6:48
  • 3
    sandu, we try to kep answers and questions separate, normally I'd ask that you add the solution as an answer rather than add it to the question, but in this case perhaps it would be better if @Qrrbrbirlbel adds the answer then you could accept it and give him some points:-) – David Carlisle Jan 2 '13 at 7:33
  • Please don't insert my answer to your question. – kiss my armpit Jan 2 '13 at 10:48

Another option is to use relative polar coordinates for the 45° line as in (3,0) -- ++(45:3) and the option slope to let the node rotated in the direction of the line, i.e. node [midway,sloped,fill=white]




\draw [step=1.0,thin,gray!40] (0,-3) grid (6,3);

\fill[blue] (3,0) circle (2pt) node [black,below left] {$C$};
\draw[thick] (3,0) circle(3);
\draw[->] (3,0) -- (6,0)  node [midway,fill=white] {3$a$};
\draw[->] (3,0) -- ++(45:3)  node [midway,sloped,fill=white] {3$a$};


  • Why use 3$a$? – user10274 Jan 2 '13 at 18:19
  • @MarcvanDongen: I don’t know I just copied from the other examples and didn’t feel like correcting it O:-) – Tobi Jan 2 '13 at 22:27

For nodes rotate=<angle> rotates around their anchor, for everything else (?) it rotates around (0,0).

rotate around

But there is the rotate around=<angle>:(<coordinate>) style!
(As always, if <coordinate> contains a comma (,), you’ll need to enclose the whole argument in braces { }.)

In this case you want

\draw[|->|, rotate around={45:(3,0)}] (3,0) -- (6,0)  node [midway,fill=white] {$3a$};

which will give you
enter image description here

transform shape

But you want to rotate the node’s text too?

My initial go-to is transform shape, but this has tremendous consequences.

For example if you use another transformation like scale=0.5 (or yet another rotation). Normally, the nodes do not get affected by this, but in this case, they would:
enter image description here

I suppose you won’t want this, right?

Therefore, I suggest the use of an extra style (or two to be precise):

  • rotate around with nodes=<angle>:<coordinate>

    This style works like rotate around and thus forwards its arguments to this style. In addition it sets the \qrrNodeRotation macro to <angle>.

  • rotate with is a style that should only be used on nodes on a path that is used with rotate around with nodes.


    rotate around with nodes/.style args={#1:#2}{
        rotate around={#1:#2},
        set node rotation={#1},
    rotate with/.style={rotate=\qrrNodeRotation},
    set node rotation/.store in=\qrrNodeRotation,
\begin{tikzpicture}[scale=.5]% scale set to 0.5 for explanation %%%
\draw [step=1.0,thin,gray!40] (0,-3) grid (6,3);

\fill[blue]  (3,0) circle (2pt) node [black,below left] {$C$};
\draw[thick] (3,0) circle (3cm);

            (3,0) -- (6,0) node [midway, fill=white]              {$3a$};
\draw[|->|, rotate around with nodes={45:(3,0)}]
            (3,0) -- (6,0) node [midway, fill=white, rotate with] {$3a$};


enter image description here

  • 2
    Another way to get this line is by means of relative polar coordinates: \draw[->|] (3,0) -- +(<angle>:3cm) node [midway,sloped] {$3a$}; – Qrrbrbirlbel Jan 2 '13 at 10:50

Just for fun with PSTricks.


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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