% !TEX TS-program = lualatex-dev

%  Pythagoras theorem with tkz-euclide
%  Created by Alain Matthes  on 2010-04-24.
%  Copyright (C) 20010 Alain Matthes  
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License , either version 1.3
% of this license or (at your option) any later version and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.%
% See http://www.latex-project.org/lppl.txt for details.
% 
\documentclass[DIV         = 14,
               fontsize    = 10,
               index       = totoc,
               twoside,
               headings    = small]{tkz-doc}

\gdef\tkznameofpack{Pythagorean theorem}
\gdef\tkzversionofpack{}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{Pythagoras}
\gdef\tkzversionofdoc{1.5c} 
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
\gdef\tkznamecollection{AlterMundus}
\gdef\tkzurlauthor{}
\gdef\tkzengine{lualatex}
\gdef\tkzurlauthorcom{http://altermundus.fr}


\usepackage[pdftex,
			      unicode,
            colorlinks=true,
            pdfpagelabels, 
            urlcolor=myblue,
            filecolor=pdffilecolor,
            linkcolor=pdflinkcolor,
            breaklinks =false,
            hyperfootnotes=false,
            bookmarks=false,
            bookmarksopen=false, 
            linktocpage=true,
            pdfsubject={Euclidean Geometry},
            pdfauthor={\tkzauthorofpack},
            pdftitle={\tkznameofpack},
            pdfkeywords={tikz, pgf, pdf, pdflatex, graphique, euclide,lualatex
		 			  geometry, points, maths, line, circle, angle ,polygon},
            pdfcreator={\tkzengine}]
				{hyperref}
\usepackage{tkz-euclide}
\usepackage[english]{babel}
\usepackage[autolanguage]{numprint}
\usepackage{tkzexample}
\usepackage{fontspec}  
\usepackage{datetime}	
\usepackage{url}
\RequirePackage{amsmath,amssymb}
\RequirePackage{textcomp}
\usepackage{xcolor,fourier} 
\usepackage[math-style=french]{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\def\UrlFont{\small\ttfamily}   

\title{The  Pythagoras' theorem}
\author{Alain Matthes}

\usepackage[format=hang,margin=10pt]{caption}
\captionsetup{style=default,labelfont={sf,bf}}
\makeatletter
\def\@captype{figure}

\makeatother
\usepackage{mdframed}
\usepackage{amsthm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Theorem
\newcounter{theo}[section] \setcounter{theo}{0}
\renewcommand{\thetheo}{\arabic{section}.\arabic{theo}}
\newenvironment{theo}[2][]{%
\refstepcounter{theo}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=myblue!20,rounded corners]
{\strut Theorem~\thetheo};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=myblue!20,rounded corners]
{\strut Theorem~\thetheo:~#1};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=MidnightBlue!20,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}
% myblue MidnightBlue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lemma

\newcounter{lem}[section] \setcounter{lem}{0}
\renewcommand{\thelem}{\arabic{section}.\arabic{lem}}
\newenvironment{lem}[2][]{%
\refstepcounter{lem}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=green!20]
{\strut Lemma~\thelem};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=green!20]
{\strut Lemma~\thelem:~#1};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=green!20,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%Proof
\newcounter{prf}[section]\setcounter{prf}{0}
\renewcommand{\theprf}{\arabic{section}.\arabic{prf}}
\newenvironment{prf}[2][]{%
\refstepcounter{prf}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=gray!20]
{\strut Proof~\theprf};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=gray!20]
{\strut Proof~\theprf:~#1};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=gray!20,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\qed\end{mdframed}}
%<---------------------------------------------------------------------------> 
\begin{document}

\title{\tkznameofpack}
\date{\today}
\clearpage
\thispagestyle{empty}
\maketitle
\newpage
\clearpage
% 
\nameoffile{\tkznameofpack}
% 


\tkzSetUpColors[background=white,text=darkgray]   

\defoffile{This document presents some pythagoras theorem proof. I made all the pictures with my  package \tkzname{tkz-euclide.sty V2.40b}. }
% 
%\presentation

\vspace*{12pt}
\lefthand\ Firstly, I would like to thank \tkzimp{Till Tantau} for the  beautiful LATEX package, namely TikZ.

\vspace*{12pt}
\lefthand\ I am grateful to  \tkzimp{Michel Bovani} for providing the \tkzname{fourier} font.

\vfill
Please report typos or any other comments to this documentation to \href{mailto:al.ma@mac.com}{\textcolor{blue}{Alain Matthes}}
   This file can be redistributed and/or modified under the terms of the LATEX 
   Project Public License Distributed from CTAN archives in directory \url{CTAN://macros/latex/base/lppl.txt}. 

\clearpage
\tableofcontents

\clearpage 
\newpage

\section{The  Pythagoras' theorem}
\begin{theo}[Pythagoras' theorem]{thm:pythagoras}
	\color{MidnightBlue}
In a right triangle, the square of the hypotenuse is equal to the sum of the squares of the catheti.
\[a^2+b^2=c^2\]
\end{theo}

The most well-known theorem in Euclid Geometry is about the right-angle triangle, commonly attributed to Pythagoras but  Greek, Chinese and Babylonian mathematicians have known about this for a long time. 
The theorem is of fundamental importance in Euclidean Geometry where it serves as a basis for the definition of distance between two points.

\medskip
\begin{theo}{The  Pythagoras' theorem} 
\emph{ In any right angled triangle, the area of the square whose side is the hypotenuse (the side opposite the right angle) is equal to the sum of the areas of the squares whose sides are the two legs (the two sides other than the hypotenuse).}
\end{theo}

\subsection{The picture}

\begin{center}
\begin{tikzpicture}
   \tkzDefPoint(0,0){C}
   \tkzDefPoint(4,0){A}
   \tkzDefPoint(0,3){B}
   \tkzDefSquare(B,A)      \tkzGetPoints{E}{F}
   \tkzDefSquare(A,C)      \tkzGetPoints{G}{H}
   \tkzDefSquare(C,B)       \tkzGetPoints{I}{J}
   \tkzFillPolygon[color  =  red   ](A,C,G,H)
   \tkzFillPolygon[color  =  blue  ](C,B,I,J)
   \tkzFillPolygon[color  =  purple](B,A,E,F)
   \tkzDrawPolygon[line width  =  1pt](A,B,C)
   \tkzDrawPolygon[line width  =  1pt](A,C,G,H)
   \tkzDrawPolygon[line width  =  1pt](C,B,I,J)
   \tkzDrawPolygon[line width  =  1pt](B,A,E,F)
   \tkzLabelSegment[above](C,A){$a$}
   \tkzLabelSegment[right](B,C){$b$}
   \tkzLabelSegment[below left](B,A){$c$}
\end{tikzpicture}
\end{center} 

\medskip
\subsection{Interpretation}
In this picture, the area of the blue square added to the area of the red square makes the area of the purple square.

\begin{prf}{This is usually summarised as:}{}
\emph{The square on the hypotenuse is equal to the sum of the squares on the other two sides.}
\end{prf}


If we let $c$ be the length of the hypotenuse and $a$ and $b$ be the lengths of the other two sides, the theorem can be expressed as the equation

\[  a^2 + b^2  =  c^2    \]

or, solved for c:

\[  c =  \sqrt{a^2 + b^2}. \]

\subsection{Code of the picture}
\begin{tkzexample}[code only]
	\begin{tikzpicture}
	   \tkzDefPoint(0,0){C}
	   \tkzDefPoint(4,0){A}
	   \tkzDefPoint(0,3){B}
	   \tkzDefSquare(B,A)      \tkzGetPoints{E}{F}
	   \tkzDefSquare(A,C)      \tkzGetPoints{G}{H}
	   \tkzDefSquare(C,B)       \tkzGetPoints{I}{J}
	   \tkzFillPolygon[color  =  red   ](A,C,G,H)
	   \tkzFillPolygon[color  =  blue  ](C,B,I,J)
	   \tkzFillPolygon[color  =  purple](B,A,E,F)
	   \tkzDrawPolygon[line width  =  1pt](A,B,C)
	   \tkzDrawPolygon[line width  =  1pt](A,C,G,H)
	   \tkzDrawPolygon[line width  =  1pt](C,B,I,J)
	   \tkzDrawPolygon[line width  =  1pt](B,A,E,F)
	   \tkzLabelSegment[above](C,A){$a$}
	   \tkzLabelSegment[right](B,C){$b$}
	   \tkzLabelSegment[below left](B,A){$c$}
	\end{tikzpicture}
\end{tkzexample}


%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>

\newpage

\input{pytha1.tex}
\input{pytha2.tex}
\input{pytha3.tex}
\input{pytha4.tex}
\input{pytha5.tex}
\input{pytha6.tex}
\input{pytha7.tex}
\input{pytha8.tex}
\input{pytha9.tex}
\input{pytha10.tex}
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>


\end{document}
