%This document can be run standalone if few comments
%are removed (at the beginning and the end of it).
%This is useful to check and modify the drawing.
%
%When used as a standalone document, the following options
%are useful:
%      tikz               to typeset the document with tikz (default)
%      inclusion          to simply include an image
%
%This document is used to draw the trigonometric circle and the
%rectangular triangle of page 4.
%
%\documentclass[tikz]{article}
%\usepackage{unit}

%\newcommand\TFourTrigOneScale{0.8}
%\begin{document}

\ifcase\DrawMethod
  %TikZ
  \savebox\UnitBox{%
     \begin{tikzpicture}[scale=\TFourTrigOneScale]
        %Coordinates of the triangle
        \coordinate (O) at (0,0);
        \coordinate (A) at (0,\pythagheight);
        \coordinate (B) at (\pythagwidth,0);
        %Coordinate of the center of the trigonometric circle
        \coordinate (C) at (\TrigoX,\TrigoY);
        %Coordinate of the begining of the mark of the angle in trigonometric circle
        %(This point is located on the x axis at the right of the center of the trigonometric
        %circle).
        \coordinate (M) at (\TrigoX+\RadiusTheta,\TrigoY);
        %Coordinate of the letter Theta to describe the angle (the radius is 1cm and the angle
        %is 35 degrees)
        \coordinate (T) at (\TrigoX+0.7cm,\TrigoY+0.25cm);
        %Coordinate of the string "(cos(θ),sin(θ))". The numeric
        %values are cos(θ) and sin(θ).
        \coordinate (String) at (\TrigoX+.819152cm,\TrigoY+.5735764cm);
        %Coordinate of the 4 points (1,0), (0,1) etc.
        \coordinate (E) at (\TrigoX+1cm+1.2em,\TrigoY-1.2ex);
        \coordinate (N) at (\TrigoX,\TrigoY+1cm+1ex);
        \coordinate (W) at (\TrigoX-1cm-1.2em,\TrigoY-1.2ex);
        \coordinate (S) at (\TrigoX,\TrigoY-1cm-1.3ex);
        %
        %Rectangular triangle with origin in (0,0) and sides OA and OB
        \draw [thick] (O) -- (A) node[midway,left] {$A$}
                  -- (B) node[midway,above] {$C$}
                  -- cycle node[midway,below] {$B$};

        %Draw the right angle symbol
        \draw (O) -- ++ (0, \ranglesize) -- ++ (\ranglesize, 0) -- ++(0,-\ranglesize) -- cycle;

        %Mark the angles
        \draw (1.5\ranglesize,1.5\ranglesize) node {$c$};
        %Angle a which is arccos(3/sqrt(3^2+2^2))=33,69 degrees rounded to 34 degrees.
        \draw (\pythagwidth-2\ranglesize,0) arc(180:146:2\ranglesize);
        %Put the the letter
        \draw (\pythagwidth-3\ranglesize,\ranglesize) node {$a$};
        %Now the second angle b 90 - 34 = 56 degrees
        \draw (0,\pythagheight-2\ranglesize) arc(270:326:2\ranglesize);
        %Put the letter
        \draw (1.5\ranglesize,\pythagheight-2.5\ranglesize) node {$b$};

        %Now the drawing of the trigonometric circle
        \draw [decoration={markings,mark=at position 1 with
            {\arrow[scale=1.3,>=latex]{>}}},postaction={decorate}] (C) --  ++(\axissize,0);
        \draw [decoration={markings,mark=at position 1 with
            {\arrow[scale=1.3,>=latex]{>}}},postaction={decorate}] (C) --  ++(-\axissize,0);
        \draw [decoration={markings,mark=at position 1 with
            {\arrow[scale=1.3,>=latex]{>}}},postaction={decorate}] (C) --  ++(0,-\axissize);
        \draw [decoration={markings,mark=at position 1 with
            {\arrow[scale=1.3,>=latex]{>}}},postaction={decorate}] (C) --  ++(0,\axissize);

        %The circle
        \draw (C) circle(1);

        %The angle Theta of 35 degrees
        \draw (C) -- ++(\ThetaAngle:1);
        %with its mark
        \draw (M) arc(0:\ThetaAngle:\RadiusTheta);
        %and then put all the labels
        %Theta
        \draw (T) node {$\theta$};
        %(cos θ, sin θ)
        \draw (String) node[right] {$(\cos\theta,\sin\theta)$};
        %the points of the compass
        \draw (E) node [below]{{\footnotesize$(1,0)$}};
        \draw (N) node [above,right]{{\footnotesize$(0,1)$}};
        \draw (W) node [below]{{\footnotesize$(-1,0)$}};
        \draw (S) node [below,right]{{\footnotesize$(-1,0)$}};
     \end{tikzpicture}
  }
\or
 %Inclusion
 \relax
\else
 \relax
\fi
%\begin{center}
%   \usebox\UnitBox
%\end{center}
%\end{document}