I really need a quick advice dealing with the answer given by sdaau. See this question. Actually I have a follow-up question regarding the given solution.
This works actually pretty fine, but the coords are a little off. Please see the screenshot. I can't get any closer to the drawn points. I sureley wnt to draw from at the generated nodes directly. They ssem to be at the expected locations, as can be seen from the orange circles. What is wrong using this code (since it doesn't compile either right now, after setting up the MWE)?
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{plotmarks, calc, intersections}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
width=10cm,
height=10cm,
axis x line = middle,
axis y line = middle,
scale only axis,
xlabel={x [mm]},
ylabel={y [mm]},
title={$\text{n}_{\text{iterations}}\text{= 2}$}
]
\addplot+[
only marks,
mark=text,
text mark={\coordindex}, % empty for now; try also \coordindex
text mark as node=true,
text mark style={%
name=p\coordindex,
color=orange,
shape=circle,
draw,
inner sep=0pt,
minimum size=0pt,
align=center,
text width=5pt,
text depth=0pt
}
]
table{%
0 0
-79.9393 236.8749
143.0014 350.0007
200.0014 350.0000
200.0008 300.0000
};
\pgfplotsextra{
% In this case, you get the point that is <dimension> away from <p> on the straight line to <q>: ($(p)!dimension!(q)$)
\path [name path=P--C-ext] (p0) -- ($(p1)!-50!(p0)$);
\draw (p0) -- (p1);
\path [name path=Rim] (p1.center) circle(50);
\path [draw, name intersections={of=P--C-ext and Rim}];
\pgfmathanglebetweenpoints{%
\pgfpointanchor{p1}{center}
}{%
\pgfpointanchor{intersection-1}{center}
}
\let\myendresult\pgfmathresult
\fill [fill=blue!50,draw=blue,thin,opacity=0.5] (p1) -- (intersection-1) arc [start angle=\myendresult,delta angle=-40,radius=50] -- cycle;
\fill [fill=blue!50,draw=blue,thin,opacity=0.5] (p1) -- (intersection-1) arc [start angle=\myendresult,delta angle=25,radius=50] -- cycle;
};
\end{axis}
\end{tikzpicture}
\end{document}