I'm creating an overlay to a picture. The picture has several objects and I want to draw arrows between them. I only have the coordinates and not the sizes so I must offset the arrows as not to overlap the objects.
Here is the image to use. Try to create an arrow, similar to the yellow curved line, to the black circle from the green circle.
I would like to "shorten" the arrows by giving a length that it offsets from both ends. (so 0cm would start and stop the arrow at the endpoints and 0.1cm will start it 0.1cm and stop it at 0.1cm) I would also like to set a curvature amount like "0.4" that will curve the arrow some amount. (0 = straight, 1 = maximum curvature possible)
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] at (0,0) {\includegraphics{hnRDQ.png}};
\coordinate (G) at (2.3,6.1);
\coordinate (R) at (6.4,3.9);
\coordinate (B) at (2.1,1.7);
\draw [green] (G) -- (R);
\draw [red] (R) -- (B);
\draw [black] (B) -- (G);
\end{tikzpicture}
(the coordinates are only approximate)
Clarify:
I want to basically specify the radius of curvature of the "arc". So, instead of having to specify the angle in and the angle out I want to specify one number. The in and out angles should be easily computed from the radius of curvature...
Basically I would like to do something like \draw (A) [arc=0.5] (B);
And it draws a 3 point arc with the 3rd point being on the radius of curvature, the 0.5 specifying out far out.
\draw [black,shorten <=1cm,shorten >=1cm] (B) -- (G);
?\draw (some node 1) -- (some node 2);
and\draw (some coordinate 1) -- (some coordinate 2);
where in the last example nodes are drawn at those coordinates. For your use case (what I can see from your picture) I recommend re-drawing those circles (as nodes).\draw (a) arc[radius=1cm, start angle=<alpha>, end angle=<beta>];
where<alpha>
and<beta>
are arbitrary angles (there's alsodelta angle
). For a less manual way, I thinktkz-euclide
can help here (especially the multi-functional\tkzDrawArc
).to
-path keysout
andin
does also exist thelooseness
key that kind of works like yourarc=0.5
specification would (PGF/TikZ manual, section 51.3 “Curves”, pp. 469ff.).