Take the 2-minute tour ×

How can I use the let syntax to draw an arc when using tikz-3dplot? At the present, the arc is drawn but doesn't look right.

\documentclass[tikz, convert = false]{standalone}
  \coordinate (O) at (0, 0, 0);
  \node[coordinate] (P) at (3, 4, 5) {};

  \draw[-latex] (O) -- +(4, 0, 0) node[font = \small, pos = 1.1] {\(x\)}
  coordinate (X);

  \draw[dashed, gray] (P) -- +(0, 0, -5) coordinate (P1) -- (O);

  \draw[-latex] let
    \p0 = (O),
    \p1 = (X),
    \p2 = (P1),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {1cm},
    \n4 = {(\n1 + \n2) / 2}
  in (O) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2];

enter image description here

share|improve this question
Why doesn’t it look right? If you add \draw (O) circle [radius=1cm]; you will see that the arrow tip adds a small nudge to the arc but otherwise it looks correct. See for a similar problem (and no solution) Why are bent arrows with arrow tips not symmetric in TikZ? –  Qrrbrbirlbel Sep 7 '13 at 21:23
@Qrrbrbirlbel it doesn't look natural. It looks skewed or bowed. –  dustin Sep 7 '13 at 21:24
@Qrrbrbirlbel it isn't the arrow tip that is the problem. It is the arc. –  dustin Sep 7 '13 at 22:05
Are you sure? Have you compared your arc with the circle path I posted earlie? If I remove -latex from the arc they nicely overlap; with the arrow tip the arc does not overlap perfectly with the circle. –  Qrrbrbirlbel Sep 7 '13 at 22:19
@Qrrbrbirlbel I see what you are saying now. Is there anything that can be done here? –  dustin Sep 7 '13 at 22:23
show 1 more comment


Your Answer



Browse other questions tagged or ask your own question.