Guest User

Untitled

a guest
Sep 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. \usepackage{mathtools}
  4. \usepackage{amssymb}
  5. \usepackage{breqn}
  6. \usepackage{graphicx}
  7. \usepackage{listings}
  8. \usepackage{systeme}
  9. \usepackage[load-configurations = abbreviations]{siunitx}
  10.  
  11. \lstset{basicstyle=\ttfamily}
  12.  
  13. \usepackage[margin=1in]{geometry}
  14.  
  15. \usepackage{fancyhdr}
  16. \pagestyle{fancy}
  17.  
  18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  19. % %
  20. % Put the Header Stuff Here %
  21. % %
  22. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  23. \chead{Center Header Goes Here}
  24. \rhead{Right Header Goes Here}
  25.  
  26. \newcommand{\proj}[2]{\operatorname{proj}_\mathbf{#2} {\mathbf{#1}}}
  27. \newcommand{\comp}[2]{\operatorname{comp}_\mathbf{#2} {\mathbf{#1}}}
  28.  
  29. \newcommand{\bvec}[1]{\mathbf{#1}}
  30. \newcommand{\unitvec}[1]{\boldsymbol{\hat{\textbf{#1}}}}
  31.  
  32. \newcommand{\dotvec}[2]{\bvec{#1} \cdot \bvec{#2}}
  33. \newcommand{\crossvec}[2]{\bvec{#1} \times \bvec{#2}}
  34.  
  35. \newcommand{\ihat}{\boldsymbol{\hat{\textbf{\i}}}}
  36. \newcommand{\jhat}{\boldsymbol{\hat{\textbf{\j}}}}
  37. \newcommand{\khat}{\boldsymbol{\hat{\textbf{k}}}}
  38.  
  39. \newcommand{\degrees}{^{\circ}}
  40. \newcommand{\rotateTwo}[1]{
  41. \renewcommand\arraystretch{1.5}
  42. \left( \begin{array}{cc}
  43. \cos { #1 } & -\sin { #1 } \\
  44. \sin { #1 } & \cos { #1 }
  45. \end{array} \right)
  46. }
  47. \newcommand{\columnVecTwo}[2]{
  48. \renewcommand\arraystretch{1.5}
  49. \left( \begin{array}{c}
  50. #1 \\ #2
  51. \end{array} \right)
  52. }
  53. \newcommand{\columnVecThree}[3]{
  54. \renewcommand\arraystretch{1.5}
  55. \left( \begin{array}{c}
  56. #1 \\ #2 \\ #3
  57. \end{array} \right)
  58. }
  59.  
  60. \makeatletter
  61. \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
  62. \hskip -\arraycolsep
  63. \let\@ifnextchar\new@ifnextchar
  64. \array{#1}}
  65. \makeatother
  66.  
  67. \newcommand{\grstep}[2][\relax]{%
  68. \ensuremath{\mathrel{
  69. {\mathop{\longrightarrow}\limits^{#2\mathstrut}_{
  70. \begin{subarray}{l} #1 \end{subarray}}}}}}
  71. \newcommand{\swap}{\leftrightarrows}
  72.  
  73. \newcommand{\norm}[1]{\left\lVert#1\right\rVert}
  74. \newcommand{\modulus}[1]{\left\lvert#1\right\rvert}
  75.  
  76. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  77. % %
  78. % Actual document starts here %
  79. % %
  80. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  81.  
  82. \begin{document}
  83.  
  84. \section*{Examples}
  85.  
  86. \subsection*{Vectors}
  87. Vectors are bolded
  88. \begin{align*}
  89. & \bvec{v}
  90. \end{align*}
  91.  
  92. \subsubsection*{Unit Vectors}
  93. Unit vectors have a hat over them.
  94. \begin{align*}
  95. & \unitvec{v}
  96. \end{align*}
  97. %
  98. % Note: \unitvec does not work properly with i and j unit vectors
  99. % (see blow)
  100. %
  101.  
  102. \subsubsection*{The $\ihat$, $\jhat$, and $\khat$ Unit Vectors}
  103. \begin{align*}
  104. & \ihat + \jhat + \khat
  105. \end{align*}
  106.  
  107. \subsubsection*{Simple Cross and Dot Products}
  108. \begin{align*}
  109. & \crossvec{u}{v} = \bvec{w} \\
  110. & \dotvec{u}{v} = c
  111. \end{align*}
  112.  
  113. \subsubsection*{Vector Projection}
  114. The component of $\bvec{a}$ onto $\bvec{b}$ is
  115. \begin{align*}
  116. & \comp{a}{b}
  117. \end{align*}
  118.  
  119. \subsubsection*{Vector Component}
  120. The projection of $\bvec{a}$ onto $\bvec{b}$ is
  121. \begin{align*}
  122. & \proj{a}{b}
  123. \end{align*}
  124.  
  125. \section*{Rotation}
  126.  
  127. \subsection*{Degrees}
  128. Degrees are not as cool as radians
  129. \begin{align*}
  130. & 90\degrees = \dfrac{\pi}{2}
  131. \end{align*}
  132.  
  133. \subsection*{2D Rotation Matrix}
  134. To rotate a point about the origin by $\dfrac{\pi}{4}$
  135. \begin{align*}
  136. & \rotateTwo{\pi/4} = \rotateTwo{45\degrees}
  137. \end{align*}
  138.  
  139. \section{Column Vectors}
  140. A 2D Column Vector
  141. \begin{align*}
  142. & \columnVecTwo{1}{2}
  143. \end{align*}
  144. A 3D Column Vector
  145. \begin{align*}
  146. & \columnVecThree{1}{2}{3}
  147. \end{align*}
  148.  
  149. \section*{Matrices}
  150.  
  151. \subsection*{Augmented Matrix}
  152.  
  153. \subsubsection*{Three (centered) columns on the left,
  154. two (centered) on the right}
  155.  
  156. \begin{align*}
  157. \begin{pmatrix}[ccc|cc]
  158. a_{11} & a_{12} & a_{13} & c_{11} & c_{12} \\
  159. a_{21} & a_{22} & a_{23} & c_{21} & c_{22} \\
  160. a_{31} & a_{32} & a_{33} & c_{31} & c_{32}
  161. \end{pmatrix}
  162. \end{align*}
  163.  
  164. \subsubsection*{Two (right-aligned) columns on the left,
  165. one (left-aligned) on the right}
  166.  
  167. \begin{align*}
  168. \begin{pmatrix}[rr|l]
  169. a_{11} & a_{12} & c_{1} \\
  170. a_{21} & a_{22} & c_{2} \\
  171. a_{31} & a_{32} & c_{3}
  172. \end{pmatrix}
  173. \end{align*}
  174.  
  175. \subsubsection*{Works on Any Kind of Bracketed Matrix}
  176. \begin{align*}
  177. \begin{bmatrix}[rr|l]
  178. a_{11} & a_{12} & c_{1} \\
  179. a_{21} & a_{22} & c_{2} \\
  180. a_{31} & a_{32} & c_{3}
  181. \end{bmatrix}
  182. \end{align*}
  183.  
  184. \subsection*{Gaussian Elimination}
  185. \begin{align*}
  186. \begin{pmatrix}[rr|l]
  187. 0 & 1 & 1 \\
  188. 1 & 1 & 2
  189. \end{pmatrix}
  190. \grstep{R_2 - R_1}
  191. \begin{pmatrix}[rr|l]
  192. 0 & 1 & 1 \\
  193. 1 & 0 & 1
  194. \end{pmatrix}
  195. \grstep{R_1 \swap R_2}
  196. \begin{pmatrix}[rr|l]
  197. 1 & 0 & 1 \\
  198. 0 & 1 & 1
  199. \end{pmatrix}
  200. \end{align*}
  201.  
  202. \section*{Other Stuff}
  203.  
  204. \subsection*{Norm}
  205. \begin{align*}
  206. & \norm{a}
  207. \end{align*}
  208.  
  209. \subsection*{Modulus}
  210. \begin{align*}
  211. & \modulus{a}
  212. \end{align*}
  213.  
  214.  
  215. \subsection*{Systems of Equations}
  216. \begin{align*}
  217. & \systeme{x + y = 2, 3x + 4y = 5} \\ \\
  218. & \systeme{x + y + z = 5, 10x + 3y + 5z = 12, 2x + 7y + 3z = 15}
  219. \end{align*}
  220.  
  221. \subsubsection*{This Even Works outside of math mode}
  222. We can solve the system \systeme{x + y = 2, 3x + 4y = 5} with Gaussian
  223. Elimination.
  224.  
  225. \subsection*{How I use Implication Arrows}
  226. \begin{align*}
  227. & x + y^2 = 5 \\
  228. \implies & y^2 = x - 5 \\
  229. \implies & y = \pm \sqrt{x - 5} \\
  230. \end{align*}
  231.  
  232. \end{document}
Add Comment
Please, Sign In to add comment