\documentclass[10pt,envcountsect]{beamer}

\mode<presentation> {
  \usetheme{Warsaw}
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{pstricks}
\usepackage{multicol}
\usepackage{mathrsfs}
\usepackage{multido}


\begin{document}

\title{Episode 01 -- Finding Pick's formula}
\subtitle{European section -- Season 3}
\date{}

\begin{frame}
  \titlepage
\end{frame}



\begin{frame}{What is a lattice ?}
\begin{definition}[Lattice]
A lattice is a square grid, a discrete surface with a regular gap between any two points. A simple
example is the set of the points with whole coordinates on a
coordinate graph.
\end{definition}

\begin{example}
\begin{center}
\psset{unit=0.5cm}
\pspicture(0,0)(10,5)
\multido{\n=0+1}{10}{
\multido{\d=0+1}{5}{
\psdot[dotstyle=o](\n,\d)
}}
\endpspicture
\end{center}\bigskip
\end{example}

\end{frame}


\begin{frame}{Lattices polygons}



\begin{center}
\psset{unit=0.35cm}
\pspicture(0,19)(30,30)
\pspolygon[fillstyle=solid,fillcolor=lightgray](0,29)(1,29)(1,25)(0,25)
\pspolygon[fillstyle=solid,fillcolor=lightgray](2,29)(6,29)(6,25)(2,25)
\pspolygon[fillstyle=solid,fillcolor=lightgray](8,29)(17,29)(17,25)(8,25)
\pspolygon[fillstyle=solid,fillcolor=lightgray](18,29)(22,29)(22,25)
\pspolygon[fillstyle=solid,fillcolor=lightgray](23,29)(29,29)(29,25)
\pspolygon[fillstyle=solid,fillcolor=lightgray](12,24)(16,22)(17,23)
\pspolygon[fillstyle=solid,fillcolor=lightgray](0,24)(5,24)(4,23)(7,22)(4,19)(2,21)
\pspolygon[fillstyle=solid,fillcolor=lightgray](9,24)(8,23)(9,22)(8,21)(9,20)(8,19)(17,20)(14,22)
\pspolygon[fillstyle=solid,fillcolor=lightgray](18,22)(22,24)(23,23)(24,24)(29,24)(25,23)(26,19)
\multido{\n=0+1}{30}{
\multido{\d=19+1}{11}{
\psdot[dotstyle=o](\n,\d)
}}
\endpspicture
\end{center}

\end{frame}


\begin{frame}{Pick's formula}

\begin{definition}[Notations]
For any polygon $P$ in a lattice, we note $B_P$ the number of points on its border and $I_P$
the number of points strictly inside the polygon. The area of the polygon will be noted
$\mathscr{A}_P$.
\end{definition}\pause


\begin{example}
\begin{columns}
	\begin{column}{6cm}
	\begin{center}
	\psset{unit=0.5cm}
	\pspicture(0,0)(10,5)
	\multido{\n=0+1}{10}{
	\multido{\d=0+1}{5}{
	\psdot[dotstyle=o](\n,\d)
	}}
	\pspolygon(1,2)(2,3)(7,4)(8,0)(5,1)
	\endpspicture
	\end{center}	
	\end{column}
	\begin{column}{4cm}
	\begin{eqnarray*}
	\uncover<+->{B_P} &=& \uncover<+->{5}\\
	I_P &=& \uncover<+->{13}
	\end{eqnarray*}
	\end{column}
\end{columns}
\bigskip
\end{example}

\end{frame}

\begin{frame}

\LARGE

\begin{center}
Find a formula involving\\ the numbers $B_P$ and $I_P$\\ to compute the area\\ of any lattice polygon.
\end{center}

\end{frame}


\begin{frame}
\begin{theorem}
For any convex polygon $P$ in a square two-dimensional lattice, 
$$\mathscr{A}_P=\frac12B_P+I_P-1.$$
\end{theorem}\pause

\begin{example}
\begin{columns}
	\begin{column}{6cm}
	\begin{center}
	\psset{unit=0.5cm}
	\pspicture(0,0)(10,5)
	\multido{\n=0+1}{10}{
	\multido{\d=0+1}{5}{
	\psdot[dotstyle=o](\n,\d)
	}}
	\pspolygon(1,2)(2,3)(7,4)(8,0)(5,1)
	\endpspicture
	\end{center}	
	\end{column}
	\begin{column}{4cm}
	\begin{eqnarray*}
	B_P &=& 5\\
	I_P &=& 13\\
	\uncover<+->{\mathscr{A}_P} &=& \uncover<+->{\frac12B_P+I_P-1}\\
	\uncover<+->{\mathscr{A}_P &=& \frac52+13-1}\\
	\uncover<+->{\mathscr{A}_P &=& \frac{29}2}
	\end{eqnarray*}
\end{column}
\end{columns}
\bigskip
\end{example}

\end{frame}




\end{document}
