\documentclass[a5paper,8pt]{extarticle}

\usepackage[margin=0.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{polski}
\usepackage{multirow}
\usepackage{multicol}

\setlength{\multicolsep}{0pt}

\usepackage{titlesec}
\titleformat{\section}   {\normalfont\Large\bfseries}{}{0em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{}{0em}{}

\title{\textbf{Algorytmy kwantowe}: trygonometria i liczby zespolone}
\date{2021-02-27}
\author{Robert Bendun (\texttt{robert@bendun.cc})}

\newcommand{\mi}{{i\mkern1mu}}
\renewcommand{\arraystretch}{1.5}

\begin{document}

\begin{center}
\makeatletter
{\Large \@title} \\ \@date, \@author \\
\makeatother
\end{center}

\section{Trygonometria}

\subsection{Wartości}

\begin{center}
\begin{tabular}{ |c|c|c|c|c|c| } \hline
	$\alpha$ (deg) & $0\degree$ & $30\degree$ & $45\degree$ & $60\degree$ & $90\degree$ \\ \hline
	$\alpha$ (rad) & $0$ & $\frac{\pi}{6}$ & $\frac{\pi}{4}$ & $\frac{\pi}{3}$ & $\frac{\pi}{2}$ \\ \hline
	$\sin$ & $0$ & $\frac{1}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{\sqrt{3}}{2}$ & $1$ \\  \hline
	$\cos$ & $1$ & $\frac{\sqrt{3}}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{1}{2}$ & $0$ \\ \hline
\end{tabular}
\end{center}

\subsection{Wzory redukcyjne}

\begin{center}
\begin{tabular}{ c | c | c | c }
	\multicolumn{2}{c|}{$ \sin -\alpha = -\sin \alpha $} &
	\multicolumn{2}{c}{$ \cos -\alpha = \sin \alpha $} \\ \hline

	$ \sin \left( \frac{\pi}{2} - \alpha \right) = \cos \alpha $ &
	$ \sin \left( \frac{\pi}{2} + \alpha \right) = \cos \alpha $ &
	$ \cos \left( \frac{\pi}{2} - \alpha \right) = \sin \alpha $ &
	$ \cos \left( \frac{\pi}{2} + \alpha \right) = -\sin \alpha $ \\

	$ \sin \left( \pi - \alpha \right) = \sin \alpha $ &
	$ \sin \left( \pi + \alpha \right) = -\sin \alpha $ &
	$ \cos \left( \pi - \alpha \right) = -\cos \alpha $ &
	$ \cos \left( \pi + \alpha \right) = -\cos \alpha $ \\
	
	\hline

	$ \sin \left( \frac{3\pi}{2} - \alpha \right) = -\cos \alpha $ &
	$ \sin \left( \frac{3\pi}{2} + \alpha \right) = -\cos \alpha $ &
	$ \cos \left( \frac{3\pi}{2} - \alpha \right) = -\sin \alpha $ &
	$ \cos \left( \frac{3\pi}{2} + \alpha \right) = \sin \alpha $ \\

	$ \sin \left( 2\pi - \alpha \right) = -\sin \alpha $ &
	$ \sin \left( 2\pi + \alpha \right) = \sin \alpha $ &
	$ \cos \left( 2\pi - \alpha \right) = \cos \alpha $ &
	$ \cos \left( 2\pi + \alpha \right) = \cos \alpha $
\end{tabular}
\end{center}

\subsection{Tożsamości}

\begin{multicols}{2}
\begin{description}
	\item $ \sin(\alpha \pm \beta) = \sin\alpha\cos\beta \pm \cos\alpha\sin\beta $
	\item $ \cos(\alpha \pm \beta) = \cos\alpha\cos\beta \mp \sin\alpha\sin\beta $
	\item $ \sin2\alpha = 2\sin\alpha\cos\alpha $
	\item $ \cos2\alpha = 2\cos^2\alpha - 1 $
\end{description}
\end{multicols}

\section{Liczby zespolone}

\subsection{Postać algebraiczna}

\begin{multicols}{2}
\begin{description}
	\item $ \alpha \pm \beta = \left( a + b\mi \right) \pm \left( c + d\mi \right) 
	= \left( a \pm c \right) + \left( b \pm d \right)\mi$
	\item $ \alpha\beta = \left( a + b\mi \right) \left( c + d\mi \right) 
	= \left( ac - bd \right) + \left( bc + ad \right)\mi$
	\item $ \frac{\alpha}{\beta} = \frac{a + b\mi}{c + d\mi} = \frac{(ac + bd) + (bc - ad)\mi}{c^2 + d^2} $
	\item[Norma] $ |\alpha| = |a + b\mi| = \sqrt{a^2 + b^2} $
	\item[Sprzężenie] $ \overline{a + \mi b} = a - b\mi $
	\item $ \alpha\overline{\alpha} = (a + b\mi)(a - b\mi) = a^2 + b^2 = |\alpha|^2 $
\end{description}
\end{multicols}

\subsection{Postać trygonometryczna}

$ z = |z|\left( \frac{a}{|z|} + \frac{b}{|z|}\mi \right) $ ponieważ $ \sin\rho = \frac{b}{|z|} $ i $ \cos\rho = \frac{a}{|z|} $ mamy równość:

$$ z = a + b\mi = |z|(\cos\rho + \mi\sin\rho) $$

\begin{description}
\item $ xy = |x|(\cos \alpha + \mi\sin\alpha) \times |y|(\cos \beta + \mi\sin\beta) =
	|x||y|\left[\cos(\alpha + \beta) + \mi\sin(\alpha+\beta)\right]$

\item $ \frac{x}{y} = |x|(\cos \alpha + \mi\sin\alpha) \div |y|(\cos \beta + \mi\sin\beta) =
	\frac{|x|}{|y|}\left[\cos(\alpha - \beta) + \mi\sin(\alpha-\beta)\right]$

\item[Wzór de Moivre'a] $ z^n = |z|^n\left(\cos(n\rho) + \mi\sin(n\rho)\right) $

\item[Pierwiastki] $ \sqrt[n]{ z } = \left\{ \sqrt[n]{|z|} \left(\cos \frac{\rho + 2k\pi}{n} + \mi\sin \frac{\rho + 2k\pi}{n} \right) \mid k = 0, 1, 2, ..., n-1  \right\} $

\item[Wzór Eulera] $ e^{\theta\mi} = \cos\theta + \mi\sin\theta $

\end{description}

	$$ \sin\theta = \frac{e^{\mi\theta} - e^{-\mi\theta}}{2\mi} \quad\quad\quad 
	\cos\theta = \frac{e^{\mi\theta} + e^{-\mi\theta}}{2\mi} $$
\end{document}
