[Tex/LaTex] Drawing the unit circle on the R^2 plane and some extra features


So I am trying to replicate the following image in latex.
The following are what I am finding hard to achieve:

  1. how do you draw a little hollow circle to mean we have right-angled triangle like the image I am trying to copy?
  2. how do you draw a red circular arrow starting from the x-axis to the hypotenius of the triangle like the image?
  3. Why is the circle broken around the x-axis?

Many thanks guys

\renewcommand{\sectionmark}[1]{\markright{#1}} %Gets rid of section number in the header%
\usepackage{blindtext} %% to add dummy text
\renewcommand{\contentsname}{Table Of Contents}%

\pgfplotsset{every axis/.append style={
        axis x line=middle,    % put the x axis in the middle
        axis y line=middle,    % put the y axis in the middle
        axis line style={<->}, % arrows on the axis
        xlabel={$x$},          % default put x on x-axis
        ylabel={$y$},   % default put y on y-axis
        title={$ $},
    % arrows as stealth fighters
        \node [below] at (axis cs: 0.2, 0) {$O$};
        \node [left] at (axis cs: -1.5, 1.3228) {$P$};
        \node [below] at (axis cs: -0.7, 0) {$x$};
        \node [left] at (axis cs: -1.5, 0.6) {$y$};
        \node [above] at (axis cs: -0.7, 0.7) {$r$};
        \node [right] at (axis cs: 0, 0.2) {$\theta$};
        \plot[thick][samples=200,domain=-2.3:2.3] {sqrt(4-x^2)};    
        \plot[thick][samples=200,domain=-2.3:2.3] {-sqrt(4-x^2)};
        \plot[ultra thick][samples=200,domain=-1.5:0] {0};
        \plot[ultra thick][samples=200,domain=-1.5:0] {-0.881866*x};
        \draw[style=ultra thick](axis cs:-1.5,0) -- (axis cs:-1.5,1.3228);

what I need to draw in Latex

Best Answer

From scratch



  % draw axis and labels. We store a single coordinate to have the
  % direction of the x axis
  \draw[->] (-4,0) -- ++(8,0) coordinate (X) node[below] {$x$};
  \draw[->] (0,-4) -- ++(0,8) node[left] {$y$};

  \draw (0,0) circle (\CircleRadius);
  % special method of noting the position of a point
  \coordinate (P) at (140:\CircleRadius);

  \draw[very thick,pattern=dots] 
  coordinate (O) % store origin
  node[below right] {$O$} % label
  node[above left,pos=1] {$P(x,y)$} % some labels
  node[above right,midway] {$r$}
  node[midway,left] {$y$}
  (P |- O) coordinate (Px) % projection onto horizontal line through
                           % O, saved for later
  node[midway,below] {$x$}
  cycle % closed path
  % pic trick is from the angles library, requires the three points of
  % the marked angle to be named
  pic [draw,red,->,angle radius=1cm,pic text=$\theta$,
  angle eccentricity=1.3] {angle=X--O--P};

  % right angle marker
  \draw ($(Px)+(0.3,0)$) -- ++(0,0.3) -- ++(-0.3,0);


enter image description here