|
| 1 | +\documentclass[a4paper, twocolumn]{article} |
| 2 | +\usepackage[landscape, a4paper, left=1cm, right=1cm, top=1cm, bottom=2cm]{geometry} |
| 3 | +\usepackage[parfill]{parskip} |
| 4 | +\usepackage{fancyhdr} |
| 5 | +\usepackage{tikz} |
| 6 | +\usepackage{xcolor} |
| 7 | +\usepackage{listings} |
| 8 | +\usepackage{amsmath} |
| 9 | +\usepackage{titlesec} |
| 10 | +\usepackage{tabularx} |
| 11 | +\usepackage{graphicx} |
| 12 | + |
| 13 | +% Colour definitions |
| 14 | +\definecolor{SpecialBlue}{RGB}{0, 166, 214} |
| 15 | + |
| 16 | +% Team Name |
| 17 | +\newcommand{\teamname}{Crystal Math} |
| 18 | + |
| 19 | +% Useful commands |
| 20 | +\renewcommand{\vec}{\overrightarrow} |
| 21 | +\newcommand{\pageend}{\vfill\newpage} |
| 22 | +\newcommand{\arrow}{$\rightarrow$ } |
| 23 | +\newcommand{\ms}{\texttt} |
| 24 | +\newcommand{\point}[4]{\draw[fill] (#1,#2) circle (1pt) node[#4] {#3}} |
| 25 | + |
| 26 | +% Syntax Highlighting |
| 27 | +\lstset{language=python} |
| 28 | +\input{highlighting.tex} |
| 29 | + |
| 30 | +% Pagestyle |
| 31 | +\renewcommand{\familydefault}{\sfdefault} |
| 32 | +\pagestyle{fancy} |
| 33 | +\newcommand{\mkfoot}{ |
| 34 | + \begin{tikzpicture}[remember picture,overlay] |
| 35 | + \node[yshift=0] at (current page.south west) { |
| 36 | + \begin{tikzpicture}[remember picture,overlay] |
| 37 | + \fill [SpecialBlue] (0cm, 0cm) rectangle (\paperwidth, 1.5cm); |
| 38 | + \end{tikzpicture} |
| 39 | + }; |
| 40 | + \end{tikzpicture} |
| 41 | +} |
| 42 | +\fancyhead{\mkfoot} |
| 43 | +\fancyfoot{} |
| 44 | +\fancyfoot[L]{\color{white} \large \textbf{\teamname} Cheatsheet} |
| 45 | +\fancyfoot[R]{\color{white} \large \textbf\thepage} |
| 46 | +\renewcommand{\headrulewidth}{0cm} |
| 47 | +\renewcommand{\headrulewidth}{0cm} |
| 48 | + |
| 49 | +\titlespacing*{\section}{0pt}{1.0pt plus 0.5pt minus .2pt}{0.8pt plus .2pt} |
| 50 | +\titlespacing*{\subsection}{0pt}{1.0pt plus 0.5pt minus .2pt}{0.8pt plus .2pt} |
| 51 | + |
| 52 | + |
| 53 | +\begin{document} |
| 54 | + |
| 55 | +\section{Modules} |
| 56 | +\subsection{Python} |
| 57 | +\begin{itemize} |
| 58 | + \item Priority queue \arrow \ms{queue.PriorityQueue} |
| 59 | +\end{itemize} |
| 60 | +\subsection{C++} |
| 61 | +\begin{itemize} |
| 62 | + \item \ms{std::pair<T,G>, std::make\_pair} \arrow \ms{\#include <utility>} |
| 63 | + \item \ms{std::vector<T>} \arrow \ms{\#include <vector>} |
| 64 | + \item \ms{std::queue<T>} (Priority queue) \arrow \ms{\#include <queue>} |
| 65 | +\end{itemize} |
| 66 | + |
| 67 | +\section{Mathematics} |
| 68 | +\subsection*{Formulas for Geometric Shapes} |
| 69 | +\vspace{-1em} |
| 70 | +\begin{align*} |
| 71 | +\text{oppervlakte cirkel} &: \pi r^2 \\ |
| 72 | +\text{omtrek cirkel} &: \pi d \\ |
| 73 | +\text{oppervlakte ellips} &: \pi a b \\ |
| 74 | +\text{oppervlakte kegel} &: \pi r^2 + \pi r \sqrt{r^2 h^2} \\ |
| 75 | +\text{inhoud kegel} &: \frac{1}{3}\pi r^2 h \\ |
| 76 | +\text{oppervlakte bol} &: 4 \pi r^2 \\ |
| 77 | +\text{inhoud bol} &: \frac{4}{3} \pi r^3 \\ |
| 78 | +\text{oppervlakte cillinder}&: 2\pi rh + 2\pi r^2 \\ |
| 79 | +\text{inhoud cilinder} &: \pi r^2 h |
| 80 | +\end{align*} |
| 81 | +\vspace{-2em} |
| 82 | +\subsection*{More Formulas} |
| 83 | +\vspace{-1.5em} |
| 84 | +\begin{align*} |
| 85 | +\text{least common multiple} &: \text{lcm}(m, n) = \frac{|m \cdot |
| 86 | + n|}{\text{gcd(m, n)}} \\ |
| 87 | +\text{Catalan number} &: C_n = \frac{1}{n+1}{2n \choose n} = |
| 88 | +\frac{(2n)!}{(n+1)!n!} = \prod^n_{k=2}\frac{n+k}{k} \\ |
| 89 | +\text{Catalan numbers} &: C = \{1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, |
| 90 | +16796\} \\ |
| 91 | +\text{Triangle numbers} &: T = \{1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, |
| 92 | +91, 105, 120, 136\} \\ |
| 93 | +\text{Triangle numbers} &: T_n = \sum_{k=1}^nk = \frac{n(n+1)}{2} = {n+1 \choose |
| 94 | + 2} |
| 95 | +\end{align*} |
| 96 | +\vspace{-1em} |
| 97 | +\newpage |
| 98 | +\subsection*{Fibonacci Numbers}\vspace*{-1em} |
| 99 | +\begin{align*} |
| 100 | +1,1,2,3,5,8,13,21,34,55,89, 144, 233, 377, 610, 987, 1597, 2584 |
| 101 | +\end{align*} |
| 102 | +\begin{itemize} |
| 103 | + \item When we take a pairs of large consecutive Fibonacci numbers, we can |
| 104 | + approximate the golden ratio by dividing them. |
| 105 | + \item The sum of any ten consecutive Fibonacci numbers is divisible by 11. |
| 106 | + \item Two consecutive Fibonacci numbers are co-prime. |
| 107 | + \item The Fibonacci numbers in the composite-number (i.e. non-prime) |
| 108 | + positions are also composite numbers. |
| 109 | +\end{itemize} |
| 110 | +\subsection*{Cross product}\vspace{-2.5em} |
| 111 | +\begin{align*} |
| 112 | +a \times b &= \begin{bmatrix} a_x \\ a_b \\ a_z \end{bmatrix} |
| 113 | +\times \begin{bmatrix} b_x \\ b_y \\ b_z \end{bmatrix} = |
| 114 | +\begin{bmatrix} a_yb_z - a_zb_y \\ a_zb_x - a_xb_z \\ |
| 115 | +a_xb_y - a_yb_x \end{bmatrix} |
| 116 | +\end{align*} |
| 117 | +\subsection*{Links of rechts ombuigen}\vspace{-0.5em} |
| 118 | +\begin{minipage}{0.45\linewidth} |
| 119 | + \begin{tikzpicture} |
| 120 | + \draw[->, >=latex] (0mm, 0mm) node[left] {A} -- (15mm, 10mm) node[above left] {B}; |
| 121 | + \draw[->, >=latex] (15mm, 10mm) -- (40mm, 20mm) node[above] {C}; |
| 122 | + \end{tikzpicture} |
| 123 | +\end{minipage}% |
| 124 | +\begin{minipage}{0.25\linewidth} |
| 125 | + \begin{align*} |
| 126 | + \vec{AB} &= \begin{bmatrix} p \\ q \end{bmatrix} \\ |
| 127 | + \vec{n} &= \begin{bmatrix} q \\ -p \end{bmatrix} \\ |
| 128 | + \end{align*} |
| 129 | +\end{minipage}% |
| 130 | +\begin{minipage}{0.25\linewidth} |
| 131 | + \begin{align*} |
| 132 | + \vec{n} &\cdot \vec{BC} < 0 \Rightarrow \text{linksaf} \\ |
| 133 | + \vec{n} &\cdot \vec{BC} > 0 \Rightarrow \text{rechtsaf} |
| 134 | + \end{align*} |
| 135 | +\end{minipage} |
| 136 | +\subsection*{Punt in concaaf/convex polygon test} |
| 137 | +Tel het aantal doorsnijdingen van polygon met lijn $P$ naar oneindig. Als het |
| 138 | +aantal \\ doorsnijdingen oneven is, dan $P \in ABCDE$. \\ |
| 139 | +\begin{minipage}{.45\linewidth} |
| 140 | + \begin{align*} |
| 141 | + \alpha &= \angle APB + ... + \angle DPE + \angle EPA \\ |
| 142 | + \alpha &= 0 \Rightarrow P \notin ABCDE \\ |
| 143 | + \alpha &= 2\pi \Rightarrow P \in ABCDE |
| 144 | + \end{align*} |
| 145 | +\end{minipage}\hfill% |
| 146 | +\begin{minipage}{.5\linewidth} |
| 147 | + \centering |
| 148 | + \begin{tikzpicture} |
| 149 | + \point{20mm}{0mm}{A}{left}; |
| 150 | + \point{10mm}{-10mm}{B}{left}; |
| 151 | + \point{40mm}{-15mm}{C}{below}; |
| 152 | + \point{55mm}{5mm}{D}{right}; |
| 153 | + \point{5mm}{10mm}{E}{left}; |
| 154 | + \point{35mm}{-2mm}{P}{below left}; |
| 155 | + \draw (20mm,0mm) -- (10mm,-10mm) -- (40mm, -15mm) -- (55mm, 5mm) -- |
| 156 | + (5mm,10mm) -- (20mm, 0mm); |
| 157 | + \draw[dashed] (35mm, -2mm) -- (20mm, 0mm); |
| 158 | + \draw[dashed] (35mm, -2mm) -- (10mm, -10mm); |
| 159 | + \draw[dashed] (35mm, -2mm) -- (40mm, -15mm); |
| 160 | + \draw[dashed] (35mm, -2mm) -- (55mm, 5mm); |
| 161 | + \draw[dashed] (35mm, -2mm) -- (5mm, 10mm); |
| 162 | + \end{tikzpicture} |
| 163 | +\end{minipage} |
| 164 | + |
| 165 | +\vspace{-2.1em} |
| 166 | +\subsection*{Centroid of polygon} \vspace{-0.3em} |
| 167 | +The centroid or geometric center of a plane figure is the arithmetic mean |
| 168 | +("average") position of all the points in the shape. Informally, it is the point |
| 169 | +at which an infinitesimally thin cutout of the shape could be perfectly balanced |
| 170 | +on the tip of a pin. |
| 171 | +\vspace{-0.5em} |
| 172 | +\begin{align*} |
| 173 | +C_x &= \frac{1}{6A}\sum_{i=0}^{n-1}(x_i+x_{i+1})(x_iy_{i+1}-x_{i+1}y_i) \\ |
| 174 | +C_y &= \frac{1}{6A}\sum_{i=0}^{n-1}(y_i+y_{i+1})(x_iy_{i+1}-x_{i+1}y_i) \\ |
| 175 | +A &= \frac{1}{2}\sum_{i=1}^{n-1}(x_iy_{i+1}-x_{i+1}y_i) |
| 176 | +\end{align*} |
| 177 | +\subsection*{Point to line distance} |
| 178 | +\begin{equation*} |
| 179 | + d(ax+by+c=0, (x_0, y_0)) = \frac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}} |
| 180 | +\end{equation*} |
| 181 | +\section{Algorithms} |
| 182 | + |
| 183 | +%PLACEHOLDER% |
| 184 | + |
| 185 | +\end{document} |
0 commit comments