\documentclass[a4paper, tikz]{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tcolorbox}
\usepackage{fancyhdr}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{arrows,
    calc,
    decorations,
    scopes,
}
\usepackage{tabularx}
\usepackage{keystroke}
\usepackage{listings}
\usepackage{xcolor} % used only to show the phantomed stuff
\definecolor{cas}{HTML}{e6f0fe}

\pagestyle{fancy}
\fancyhead[LO,LE]{Year 12 Specialist - Dynamics}
\fancyhead[CO,CE]{Andrew Lorimer}

\setlength\parindent{0pt}

\begin{document}

  \title{Dynamics}
  \author{}
  \date{}
  \maketitle

  \section{Resolution of forces}

  \textbf{Resultant force} is sum of force vectors

  \subsection{In angle-magnitude form}

  \makebox[3cm]{Cosine rule:} \(c^2=a^2+b^2-2ab\cos\theta\)
  \makebox[3cm]{Sine rule:} \(\dfrac{a}{\sin A}=\dfrac{b}{\sin B}=\dfrac{c}{\sin C}\)
  
  \subsection{In \(\boldsymbol{i}\)---\(\boldsymbol{j}\) form}

  Vector of \(a\) N at \(\theta\) to \(x\) axis is equal to \(a \cos \theta \boldsymbol{i} + a \sin \theta \boldsymbol{j}\). Convert all force vectors then add.

  To find angle of an \(a\boldsymbol{i} + b\boldsymbol{j}\) vector, use \(\theta = \tan^{-1} \frac{b}{a}\)

  \subsection{Resolving in a given direction}

  The resolved part of a force \(P\) at angle \(\theta\) is has magnitude \(P \cos \theta\)

  \section{Newton's laws}
  
  \begin{enumerate}
    \item Velocity is constant without a net external velocity
    \item \(\frac{d}{dt} \rho \propto \Sigma F \implies \boldsymbol{F}=m\boldsymbol{a}\)
    \item Equal and opposite forces
  \end{enumerate}

  \subsection{Weight}
  A mass of \(m\) kg has force of \(mg\) acting on it

  \subsection{Momentum \(\rho\)}
  \[ \rho = mv \tag{units kg m/s or Ns} \]

  \subsection{Reaction force \(R\)}

  \begin{itemize}
    \item With no vertical velocity, \(R=mg\)
    \item With upwards acceleration, \(R-mg=ma\)
    \item With force \(F\) at angle \(\theta\), then \(R=mg-F\sin\theta\)
  \end{itemize}

  \subsection{Friction}

  \[ F_R = \mu R \tag{friction coefficient} \]

  \section{Inclined planes}

  \[ \boldsymbol{F} = |\boldsymbol{F}| \cos \theta \boldsymbol{i} + |\boldsymbol{F}| \sin \theta \boldsymbol{j} \]
 \def\iangle{30} % Angle of the inclined plane

    \def\down{-90}
    \def\arcr{0.5cm} % Radius of the arc used to indicate angles

\begin{tikzpicture}[
        >=latex',
        scale=1,
        force/.style={->,draw=blue,fill=blue},
        axis/.style={densely dashed,gray,font=\small},
        M/.style={rectangle,draw,fill=lightgray,minimum size=0.5cm,thin},
        m/.style={rectangle,draw=black,fill=lightgray,minimum size=0.3cm,thin},
        plane/.style={draw=black,fill=blue!10},
        string/.style={draw=red, thick},
        pulley/.style={thick},
        ]
        \pgfmathsetmacro{\Fnorme}{2}
        \pgfmathsetmacro{\Fangle}{30}
        \begin{scope}[rotate=\iangle]
            \node[M,transform shape] (M) {};
            \coordinate (xmin) at ($(M.south west)-({abs(1.1*\Fnorme*sin(-\Fangle))},0)$);
            \coordinate (xmax) at ($(M.south east)+({abs(1.1*\Fnorme*sin(-\Fangle))},0)$);
            \coordinate (ymax) at ($(M.north)+(0, {abs(1.1*\Fnorme*cos(-\Fangle))})$);
            \coordinate (ymin) at ($(M.south)-(0, 1cm)$);
            \coordinate (axiscentre) at ($(M.south)+(0.5cm, 0.5cm)$);
            \draw[postaction={decorate, decoration={border, segment length=2pt, angle=-45},draw,red}] (xmin) -- (xmax);
            \coordinate (N) at ($(M.center)+(0,{\Fnorme*cos(-\Fangle)})$);
            \coordinate (fr) at ($(M.center)+({\Fnorme*sin(-\Fangle)}, 0)$);
            % Draw axes and help lines

            {[axis,->]
                \draw (ymin) -- (ymax) node[right] {\(\boldsymbol{j}\)};
                \draw (M) --(M-|xmax) node[right] {\(\boldsymbol{i}\)};    % mental note for me: change "right" to "above"
            }

            % Forces
            {[force,->]
                % Assuming that Mg = 1. The normal force will therefore be cos(alpha)
                \draw (M.center) -- (N) node [right] {\(R\)};
                \draw (M.center) -- (fr) node [left] {\(\mu R\)};
            }
%            \draw [densely dotted, gray] (fr) |- (N) node [pos=.25, left] {\tiny$\lVert \vec F\rVert\cos\theta$} node [pos=.75, above] {\tiny$\lVert \vec F\rVert\sin\theta$};
        \end{scope}
        % Draw gravity force. The code is put outside the rotated
        % scope for simplicity. No need to do any angle calculations. 
        \draw[force,->] (M.center) -- ++(0,-1) node[below] {$mg$};
        \draw (M.center)+(-90:\arcr) arc [start angle=-90,end angle=\iangle-90,radius=\arcr] node [below, pos=.5] {\tiny\(\theta\)};
    \end{tikzpicture}

  \subsection{Connected particles}

  \begin{itemize}
    \item \textbf{Suspended pulley:} tension in both sections of rope are equal
    \item \textbf{Linear connection:} find acceleration of system first
    \item \textbf{Pulley on edge of incline:} find downwards force \(W_2\) and components of mass on plane
  \end{itemize}

\end{document}
