3

I have

\draw[draw=black!80,solid, -triangle 90,fill=black!80] (2.6, 4) -- (3.3, 4);

I'd like the endpoints to be where they are, but I need it to arc. How do I do this?

Edit: I'm looking for something like this:

\draw [->] (0,0) arc (180:30:10pt);

enter image description here

Something like the curved arrow, except with the endpoints that I have. I need the triangle on mine to be oriented correctly though.

It doesn't have to appear to trace the top of a circle, it just has to go up in down in a curvilinear fashion (it's because there's currently another line that goes in the straight path). So, essentially, I'm trying to get 2 points from the exact starting point, to the exact endpoint. One line is already going in a straight line from A to B. But now I need to display another line; hence my need to curve the arrow.

6
  • Are you looking for something like this: writelatex.com/132583mshwhw?
    – kan
    Apr 5, 2013 at 19:39
  • From you edit, I infer that, you're looking for something along the lines of Pg.46 of the manual. I am afraid, I won't be of much help otherwise. I am sorry.
    – kan
    Apr 5, 2013 at 19:49
  • @KannappanSampath Better reference would be the section 51.3 “Curves” where the complexity of the curve to style is explained in detail (out/in, relative, all the bending keys, the distances and the loosenesses, the controls). And, there's also (c1) .. controls (c2) [and (c3)] .. (c4). Apr 5, 2013 at 19:58
  • @AlanH Could you add a picture of what you want to achieve? There are many ways to connect two points with an arc. Apr 5, 2013 at 19:59
  • @Qrrbrbirlbel Will read it later tommorrow! Thanks for the pointers.
    – kan
    Apr 5, 2013 at 20:09

1 Answer 1

3

I don't know if any TikZ frontend commands exist for this (I guess there are but elude me). You can use the lower level commands to get the node border point that lives on the line as if you draw a hypothetical one from the source node to the target node intersecting the node shape.

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\node[draw] (a) at (0,0) {A};
\node[draw,circle] (b) at (2,1) {B};
\draw[-latex] (a) -- (b);

\pgfcoordinate{c}{% a coordinate named c at....
    \pgfpointshapeborder{a}{% the point on the border of node a
        \pgfpointanchor{b}{center}% that sees the center anchor of node b
    }
}
% Same for the border point of b
\pgfcoordinate{d}{\pgfpointshapeborder{b}{\pgfpointanchor{a}{center}}}

% Let's see if we make sense
\draw (c) edge[-latex,bend right] (d);
\end{tikzpicture}
\end{document}

enter image description here

I am not responsible for the ugliness of the arrows. Be careful what you wish for :)

8
  • what if you lowered the arrow a bit so that the arrow heads were separate? Apr 5, 2013 at 20:40
  • @AlanH But that's what you are trying to avoid with this question no?
    – percusse
    Apr 5, 2013 at 20:42
  • @AlanH Yes, but I didn't think the arrows would look like that... Apr 5, 2013 at 20:45
  • @AlanH Change the (d) to (b) in the last draw command. Would that be sufficient? The starting point is the same but they arrive at different points....
    – percusse
    Apr 5, 2013 at 20:46
  • Well, I guess as long as the idea is conveyed... Apr 5, 2013 at 20:47

Not the answer you're looking for? Browse other questions tagged .