\input{Preambule}%

\begin{document}
\begin{tikzpicture}[%
    show background rectangle,%
    tight background,%
    background rectangle/.style={fill=white}%
  ]
  % Styles
  \tikzset{fleche/.style={->, -{Latex}}}%
  \tikzset{interdit/.style={pattern=north east lines, pattern color=red}}%
  \tikzset{point/.pic={\filldraw[#1] (0,0) circle[radius=0.05];}, point/.default=black}%

  % Paramètres
  \pgfmathsetmacro{\r}{3.5}%
  \pgfmathsetmacro{\R}{1.1 * \r}%
  \pgfmathsetmacro{\pth}{0.8 * \r}%
  \pgfmathsetmacro{\angth}{acos(\pth/\r)}%
  \pgfmathsetmacro{\qth}{\r * sin(\angth)}%
  \pgfmathsetmacro{\startangle}{-10}%
  \pgfmathsetmacro{\endangle}{90-\startangle}%

  % Axes
  \pgfmathsetmacro{\tmp}{\r*cos(90-\startangle)};%
  \draw[fleche] (\tmp,0) -- (\R,0) node[below right] {$P$};%
  \pgfmathsetmacro{\tmp}{\r*sin(\startangle)};%
  \draw[fleche] (0,\tmp) -- (0,\R) node[above right] {$Q$};%

  % Circle
  \draw (\startangle:\r) arc[start angle=\startangle, end angle=\endangle, radius=\r];%
  \pgfmathsetmacro{\tmp}{\r*sin(\startangle)};%
  \pgfmathsetmacro{\tmpdeux}{\r*cos(\endangle)};%
  \pgfmathsetmacro{\tmptrois}{\r*sin(\endangle)};%
  \fill[interdit] (0,\tmp) -- (\tmpdeux,\tmp) -- (\tmpdeux,\tmptrois) arc[start angle=\endangle,
      end angle=90, radius=\r];%
  \draw[fleche] (0,0) -- (20:\r) node[above, midway, sloped] {$\smax$};%

  % Rectangle
  \draw (0,\r) -- (\r,\r) -- (\r,0);%

  % Theoretical power
  \draw (\pth,0) -- (\pth,\r) node[below left] at (\pth,0) {$P^{\theo}$};%
  \pgfmathsetmacro{\tmp}{\r*sin(\startangle)};%
  \fill[interdit] (\pth,\qth) arc[start angle=\angth, end angle=\startangle, radius=\r] --
  (\pth,\tmp);%

  % Point P^{\theo}
  \path (\pth,0) pic[pic type=point];%

  % Point outside of the circle
  \pgfmathsetmacro{\rayon}{1.15*\r}%
  \pgfmathsetmacro{\anglevaleur}{55}%
  \coordinate (S) at (\anglevaleur:\rayon);%

  \node[right] at (S) {$\underline{S}$};%
  \path (S) pic[pic type=point];%

  % Projection
  \coordinate (S correct) at (\anglevaleur:\r);%
  \draw[fleche, blue] (S) -- (S correct);%
  \path (S correct) pic {point=blue};%
  \node[below left] at (S correct) {$\underline{S^{\text{proj.}}}$};%
\end{tikzpicture}
\end{document}
% Local Variables:
% mode: latex
% TeX-engine: luatex
% TeX-source-correlate-method-active: synctex
% ispell-local-dictionary: "british"
% coding: utf-8
% LaTeX-indent-level: 2
% fill-column: 120
% End:
