
%% Custom Environments

    \newtheorem{theorem}{Theorem}[section]
    \newtheorem{definition}[theorem]{Definition}
    \newtheorem{corollary}[theorem]{Corollary}
    \newtheorem{proposition}[theorem]{Proposition}
    \newtheorem{lemma}[theorem]{Lemma}
    \newtheorem{fact}[theorem]{Fact}
    \newtheorem{claim}[theorem]{Claim}

%% Enclosing Brackets

    \newcommand{\prl} [1] {\!\left(#1\right)}
    \newcommand{\brl} [1] {  \left[ #1 \right] }
    \newcommand{\crl} [1] { \left\{ #1 \right\} }
    \newcommand{\norm} [1] { \parallel #1 \parallel}
    \newcommand{\twonorm} [1] { \parallel #1 \parallel_{2}}
    \newcommand{\ldist} [2] { \delta_l(#1,#2)}
    \newcommand{\compdist} [2] { \delta_j(#1,#2)}

%% Miscellaneous Arrays
    \newcommand{\threevecbig}[3]{\left[\begin{array}{c}
          #1\\[2.5ex] #2\\[2.5ex] #3 \\
        \end{array} 
      \right]}
    \newcommand{\fourvecbig}[4]{\left[\begin{array}{c}
          #1\\[2.5ex] #2\\[2.5ex] #3 \\[2.5ex] #4\\
        \end{array} 
      \right]}
    \newcommand{\fivevecbig}[5]{\left[\begin{array}{c}
          #1\\[2.5ex] #2\\[2.5ex] #3 \\[2.5ex] #4\\[2.5ex] #5\\
        \end{array} 
      \right]}

    \newcommand{\twovec} [2] { \left[ \begin{array}{c} 
          #1 \\ #2 \end{array} \right] }
    
    \newcommand{\twovecT} [2] { \left[ \begin{array}{ccc} 
          #1 & #2 \end{array} \right] }
    
    \newcommand{\threevec} [3] { \left[ \begin{array}{c} 
          #1 \\ #2 \\ #3 \end{array} \right] }
    
    \newcommand{\threevecT} [3] { \left[ \begin{array}{ccc} 
          #1 & #2 & #3 \end{array} \right] }
    
    \newcommand{\fourvect} [4] { [\;#1,\;#2,\;#3,\;#4\;]^T }
    \newcommand{\fivevect}[5] { [\;#1,\;#2,\;#3,\;#4\;#5\;]^T } 
    
    \newcommand{\twomatrix}[4]{ \left[\begin{array}{cc}
                                   #1 & #2\\
                                   #3 & #4\\
                                 \end{array}
                           \right]}

%% Derivtives etc.

    \newcommand{\deriv}[2]{ \frac{\text{d} #1}{\text{d} #2} }
    \newcommand{\ddt}[1] { \frac{\text{d}}{\text{d}t} \prl{#1} }
    \newcommand{\dddt}[1] { \frac{\text{d}^2}{\text{d}t^2} \prl{#1} }
    \newcommand{\Deriv}[2]{ \frac{\delta #1}{\delta #2} }
    \newcommand{\bigD}[1] { \mathcal{D} #1 }

%% References

    \newcommand{\req}[1]{(\ref{#1})}
    \newcommand{\refig}[1]{Figure \ref{#1}}

%% Some useful symbols:

    \newcommand{\dotol}[1]{\dot {\ol #1}}
    \newcommand{\innerProd}[2]{\left< #1 | #2 \right>}
    \def \df{  \: {\mathbf := }  \: }
    \def \ldf{  \: {\mathbf := }  \: }
    \def \rdf{  \: {\mathbf =: } \:  }
    \def \en{ \;\; }

%% Useful math definitions

   \def \acot {\mathrm{acot}}
   \def \atan {\mathrm{atan}}
   \def \asin {\mathrm{asin}}

