There's something strange going on with the animation at 135 degrees. I can't figure out what's going wrong.

enter image description here

Here's the MWE:


            \draw[fill]  (0,0) coordinate [label=180:Z] (Z) circle (2pt);           %% center of the picture
            \draw[fill]  (5,5) coordinate [label=135:Q] (Q) circle (2pt);           %% center of the circle
            \draw[fill]  (Q) -- +(  0:6)   coordinate [label=0:A] (A) circle (2pt); %% first point on the circle
            \clip[draw] (Q)  circle (4.5cm);
            \draw[help lines,blue!20,step=1] (0,0) grid (12,12);
            %% drawing the circle
            \draw[blue]  (A) 
                         let \p1 = ($ (A) - (Q) $) in

            \draw [line width=0.4pt,red]
                  let \p1 = ($(A) - (Q)$), \n1={veclen(\x1,\y1)} in
                  (Q) -- +(#1:\n1)
                  coordinate (B) circle (2pt);

            \draw[purple,line width=0.4pt] 
                  (B) -- +($  (0,0) ! 2em ! 0 : ($(B)-(Q)$)  $)  
                  coordinate [label=center:{\textbf{B:#1}}] (Bl) circle (2em);

                  ($ (B) ! 0.45 ! (Q) $) 
                  coordinate (tC) circle (2pt);

            \draw[line width=01.5em,->]
                  let \p1 = ($(tC) - (Q)$), 
                      \n1={atan2(\x1,\y1)}, %% start angle
                      \n2={\n1+90},         %% end angle
                      \n3={veclen(\x1,\y1)} %% radius
                      arc (\n1:\n2:\n3)
                      -- ++(\n2+80:1em)



  • Hm, interesting. Anyway, why don’t you just use #1 for \n1? You probably could also simplify a lot more … Feb 17 '13 at 3:15
  • @GarbageCollector. What did you do to get the animation to work?
    – A.Ellett
    Feb 17 '13 at 3:41
  • 1
    @A.Ellett (You might remove the animating bit as it has nothing to do with problem.) The culprit seems to be the divide function of PGF math. Check the output of \pgfmathparse{33.19675/-33.19678}\pgfmathresult and vary the divisor’s last digit. It jumps from -1.0 (last digit: 5) to -0.1 (6 to 8) to -0.99998 (9). Feb 17 '13 at 5:22
  • 1
    @Qrrbrbirlbel This bug is fixed in the current CVS version of TikZ/PGF. Feb 17 '13 at 8:32
  • 1
    @PaulGaborit You are right. The \pgfmathdivide@@ macro has been patched (with the help of a few others). Changelog of 2011-04-18. @A.Ellett Maybe it is time for you to update to the CVS version after all … Feb 17 '13 at 8:42

There is no angle discontinuity in PSTricks.

enter image description here


        (!1 \i\space 45 add PtoC){Head}
  • 4
    There is no TikZ in PSTricks. ;) Feb 17 '13 at 4:47
  • 1
    I love the answer, but unfortunately I already know how to do this in pstricks. My objective was to learn how to use tikz. Nevertheless, great answer!
    – A.Ellett
    Feb 17 '13 at 4:57
  • Actually, there's a bit of syntax in your answer I'm not familiar with. What are you doing when you write ([nodesep=2.8]{Tail}Q}{C}? Actually, I can see it's a translation, but where is it documented?
    – A.Ellett
    Feb 17 '13 at 5:52
  • @A.Ellett: It represents a node which is 2.8 apart from Q node in the direction of a vector from Q node to Tail node. It is documented in pstricks-doc.pdf on page 147. Use texdoc pstricks-doc to open the documentation. Feb 17 '13 at 6:44

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.