I want to draw an arc with a given radius from the point the arc intersects with a given circle to the point where the arc intersects with another circle. I have been reading through a lot of the TikZ manual, but to no avail. Can anyone help?
This PDF (http://www.mycroft.ch/tikztest.pdf) (MWE below) is intended to illustrate the problem. There are four circles, a part of each I want to use as path. The resulting curved wedge is then to be filled in black.
The green arc is no problem, I have start angle and end angle for it. For the two orange arcs I only have one angle (the one near the red circle is just an estimate). For the red arc I have nothing (both ends are estimates, thought to illustrate).
Interestingly, I can calculate the intersections (marked by the red circles), but I cannot fathom how to draw an arc there.
Hopefully I am overlooking something incredibly obvious! Thanks.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections,scopes}
\tikzset{
pics/carc/.style args={#1:#2:#3}{
code={
\draw[pic actions] (#1:#3) arc(#1:#2:#3);
}
}
}
\begin{document}
\begin{tikzpicture}
\draw [name path=three] (120:1.06) circle (1.9);
\draw [name path=four] (0:1.06) circle (2.12);
\draw [name path=five] (0:0.77) circle (2.41);
\draw [name path=two] (0:0) circle (1.06);
\draw[green, thick] (0:3.18) arc [radius=2.12, start angle=0, end angle=180];
\draw[orange, thick] (0:3.18) arc [radius=2.41, start angle=0, end angle=197];
\draw[orange, thick] (180:1.06) arc [radius=1.06, start angle=180, end angle=245];
\draw[red, thick, name intersections={of=five and three}] (intersection-2) circle (2pt) node {};
\draw[red, thick, name intersections={of=two and three}] (intersection-1) circle (2pt) node {};
{ [xshift=-0.53cm,yshift=0.918cm] \pic [red,thick] {carc=238:274:1.9}; }
\end{tikzpicture}
\end{document}







xshiftsandyshiftsoptions? – LaX Apr 16 '15 at 16:50- Draw an arc, whose underlying circle is centered in (120:1.06) and the radius is (1.9).
- Starting point of that arc should be where this circle intersects with the other circle ("five).
- Ending point of that arc should be where the arc's underlying circle intersects with yet another circle ("two").
– Thorsten Apr 16 '15 at 16:53\clipin ascopeenvironment? – LaX Apr 16 '15 at 17:33\clip[draw] (center) -- ($(center)!2.5!(A)$) -- ($(center)!2.5!(B)$) -- cycle;. I added coordinates to your intersections:\draw[red, thick, name intersections={of=five and three}] (intersection-2) circle (2pt) node[below] {$A$} coordinate (A), did the same for(B)and defined(center)with\coordinate (center) at (120:1.06);. Wrap the clip in a scope env., along with\draw [red,thick] (120:1.06) circle (1.9);for the arc. This is just an example with a clip, but obviously this solution is not very nice as you have to adapt the clip to your draw every time. – LaX Apr 16 '15 at 22:14($(center)!2.5!(A)$)draws a line starting at the(center)coordinates, in the direction of(A), with a lenght 2.5 times the(A) — (center)distance. – LaX Apr 16 '15 at 22:17+(a:b)syntax? It's the same as++(a:b), except it allows you to keep the first coordinate as an origin. For instance,(1,0) ++(-1,0) ++(1,0)will do the following path:(1,0) -> (0,0) -> (1,0)while(1,0) +(-1,0) +(1,0)will follow(1,0) -> (0,0) -> (2,0). The issue that remains is that even in polar coordinates, a path from a point to another will remain a line and not an arc. – LaX Apr 17 '15 at 12:54