I am trying to connect the origin of my picture (Black dot) and the different colored dots around it by drawing and filling arcs. As you can see in the image attached, its relatively easy to do by using "raw" tikZ and calculating by hand the different points where the arcs should start and end (I did not do it for this MWE). My question is:
Knowing the starting point (Colored),the "middle" point of the arc (Origin), and how long they should be in degrees (lets say 30 deg) is it possible to automatize the generation of these arcs using tikZ?
I would guess it implies moving the "origin" of the command arc to the straight line between the colored points and the origin, and then draw an arch from (-degrees/2 : degrees/2), but I do not know how I should implement this or whether it is possible. I would appreciate any help or guidance.
Below the MWE:
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{positioning,calc}
\tikzstyle{help lines}=[thin,gray!40]
\begin{document}
\begin{tikzpicture}
\draw[help lines,step=1] (-3,-3) grid (3,3);
\coordinate (Origin) at (0,0);
%- Red
\begin{scope}[thick,color=red,shift={(-3,1)}]
\coordinate (Red) at (0,0);
\draw[fill] (Red) circle (4pt) node[above,yshift=0.1cm] {Red};
\draw[dashed] (Red) -- (Origin) node[midway,above]{$r_\mathrm{1}$};
\fill[opacity=0.3] (0,0) -- (-10:3.5) arc (-10:-40:3.5) -- cycle;
\end{scope}
%- Blue
\begin{scope}[thick,color=blue,shift={(-2,-2)}]
\coordinate (Blue) at (0,0);
\draw[fill] (Blue) circle (4pt) node[below,yshift=-0.1cm] {Blue};
\draw[dashed] (Blue) -- (Origin) node[midway,above left]{$r_\mathrm{2}$};
\fill[opacity=0.3] (0,0) -- (25:3.3) arc (25:55:3.3) -- cycle;
\end{scope}
%- Orange
\begin{scope}[thick,color=orange,shift={(1,2.5)}]
\coordinate (Orange) at (0,0);
\draw[fill] (Orange) circle (4pt) node[above,yshift=0.1cm] {Orange};
\draw[dashed] (Orange) -- (Origin) node[midway,above left]{$r_\mathrm{3}$};
\fill[opacity=0.3] (0,0) -- (240:3) arc (240:270:3) -- cycle;
\end{scope}
\draw[fill] (Origin) circle (4pt) node[right,xshift=0.1cm] {Origin};
\end{tikzpicture}
\end{document}
\draw [red] (Red) -- ++(-40:3.5) arc (-40:-10:3.5) -- cycle;
?/drawArcArea(Red, Origin, 30)
would draw a triangle starting at Red, going to - 15 deg below origin, then arc between - 15 and +15 deg and then cycle back to red.#1
to#2
within the\drawArcArea
macro. The\veclen
macro should be able to help with that.