% proflycee-tools-trigo.tex
% Copyright 2023  Cédric Pierquet
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.

%%------CercleTrigo
\defKV[cercletrigo]{%
	Rayon=\def\PLcerclerayon{#1},%
	Epaisseur=\def\PLcerclethick{#1},%
	EpaisseurSol=\def\PLcerclesolthick{#1},%
	Marge=\def\PLcerclemarge{#1},%
	TailleValeurs=\def\PLcerclevaleurs{#1},%
	TailleAngles=\def\PLcercleangles{#1},%
	CouleurFond=\def\PLcerclefond{#1},%
	Decal=\def\PLcercledecal{#1},%
	cos=\def\PLcerclevalcos{#1},%
	sin=\def\PLcerclevalsin{#1},%
	CouleurSol=\def\PLcerclecoleq{#1}
}

\setKVdefault[cercletrigo]{
	Rayon=3,%
	Marge=0.25,%
	Decal=10pt,%
	Epaisseur=thick,%
	EpaisseurSol=very thick,%
	AffAngles=true,%
	AffTraits=true,%
	AffTraitsEq=true,%
	AffValeurs=true,%
	MoinsPi=true,%
	TailleValeurs=\scriptsize,%
	TailleAngles=\footnotesize,%
	CouleurFond=white,%
	Equationcos=false,%
	Equationsin=false,%
	cos=45,%
	sin=30,%
	CouleurSol=blue
}

\newcommand\CercleTrigo[1][]{%
	\useKVdefault[cercletrigo]
	\setKV[cercletrigo]{#1}
	\tikzset{PLval/.style={inner sep=1pt,font=\PLcerclevaleurs,fill=\PLcerclefond}}
	\tikzset{PLagl/.style={inner sep=1pt,font=\PLcercleangles,fill=\PLcerclefond}}
	%valeurs remarquables
	\ifboolKV[cercletrigo]{AffAngles}
	{%valeursdudessus
		\draw ({\PLcerclerayon},0) node[above right=2pt,font=\PLcercleangles] {0} ;
		\draw ($(30:{\PLcerclerayon})+(30:\PLcercledecal)$) node[PLagl] {$\tfrac{\pi}{6}$} ;
		\draw ($(45:{\PLcerclerayon})+(45:\PLcercledecal)$) node[PLagl] {$\tfrac{\pi}{4}$} ;
		\draw ($(60:{\PLcerclerayon})+(60:\PLcercledecal)$) node[PLagl] {$\tfrac{\pi}{3}$} ;
		\draw (0,{\PLcerclerayon}) node[above right=2pt,PLagl] {$\tfrac{\pi}{2}$} ;
		\draw ({-\PLcerclerayon},0) node[above left=2pt,PLagl] {$\pi$} ;
		\draw ($(150:{\PLcerclerayon})+(150:\PLcercledecal)$) node[PLagl] {$\tfrac{5\pi}{6}$} ;
		\draw ($(135:{\PLcerclerayon})+(135:\PLcercledecal)$) node[PLagl] {$\tfrac{3\pi}{4}$} ;
		\draw ($(120:{\PLcerclerayon})+(120:\PLcercledecal)$) node[PLagl] {$\tfrac{2\pi}{3}$} ;
		\draw ($(30:{\PLcerclerayon})+(30:\PLcercledecal)$) node[PLagl] {$\tfrac{\pi}{6}$} ;
		%valeursdudessous
		\draw ($(-30:{\PLcerclerayon})+(-30:\PLcercledecal)$) node[PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-}{11}\pi}{6}$} ;
		\draw ($(-45:{\PLcerclerayon})+(-45:\PLcercledecal)$) node[PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-}{7}\pi}{4}$} ;
		\draw ($(-60:{\PLcerclerayon})+(-60:\PLcercledecal)$) node[PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-}{5}\pi}{3}$} ;
		\draw (0,{-\PLcerclerayon}) node[below right=2pt,PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-}{3}\pi}{2}$} ;
		\draw ($(-120:{\PLcerclerayon})+(-120:\PLcercledecal)$) node[PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-2}{4}\pi}{3}$} ;
		\draw ($(-135:{\PLcerclerayon})+(-135:\PLcercledecal)$) node[PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-3}{5}\pi}{4}$} ;
		\draw ($(-150:{\PLcerclerayon})+(-150:\PLcercledecal)$) node[PLagl] {$\tfrac{\ifboolKV[cercletrigo]{MoinsPi}{-5}{7}\pi}{6}$} ;
		\ifboolKV[cercletrigo]{MoinsPi}
		{\draw ({-\PLcerclerayon},0) node[below left=2pt,PLagl] {$-\pi$} ;}
		{\draw ({\PLcerclerayon},0) node[below right=2pt,PLagl] {$2\pi$} ;}
	}%
	{}
	%tracés
	\draw[\PLcerclethick,->,>=latex] ({-\PLcerclerayon-\PLcerclemarge},0)--({\PLcerclerayon+\PLcerclemarge},0) ;
	\draw[\PLcerclethick,->,>=latex] (0,{-\PLcerclerayon-\PLcerclemarge})--(0,{\PLcerclerayon+\PLcerclemarge}) ;
	\draw[\PLcerclethick] (0,0) circle[radius=\PLcerclerayon] ;
	\draw (0,0) node[below left=2pt,PLval] {0} ;
	%equations
	\ifboolKV[cercletrigo]{Equationcos}
	{%traitsdeconstructioncos
		\ifboolKV[cercletrigo]{AffTraitsEq}
			{%
				\draw[\PLcerclethick,dotted,gray] (-45:\PLcerclerayon) -- (135:\PLcerclerayon)
												  (-135:\PLcerclerayon) -- (45:\PLcerclerayon)
												  (30:\PLcerclerayon) -- (150:\PLcerclerayon)
												  (-30:\PLcerclerayon) -- (-150:\PLcerclerayon)
												  (-60:\PLcerclerayon)--(60:\PLcerclerayon)
												  (-120:\PLcerclerayon)--(120:\PLcerclerayon) ;
			}{}%
		\draw[\PLcerclesolthick,\PLcerclecoleq] ({\PLcerclevalcos}:\PLcerclerayon)--({-\PLcerclevalcos}:\PLcerclerayon) ;
		\filldraw[\PLcerclecoleq] ({\PLcerclevalcos}:\PLcerclerayon) circle[radius=2pt] ({-\PLcerclevalcos}:\PLcerclerayon) circle[radius=2pt] ;%
	}
	{}
	\ifboolKV[cercletrigo]{Equationsin}
	{%traitsdeconstructioncos
		\ifboolKV[cercletrigo]{AffTraitsEq}
			{%
				\draw[\PLcerclethick,dotted,gray] (-45:\PLcerclerayon) -- (135:\PLcerclerayon)
				(-135:\PLcerclerayon) -- (45:\PLcerclerayon)
				(30:\PLcerclerayon) -- (150:\PLcerclerayon)
				(-30:\PLcerclerayon) -- (-150:\PLcerclerayon)
				(-60:\PLcerclerayon)--(60:\PLcerclerayon)
				(-120:\PLcerclerayon)--(120:\PLcerclerayon) ;
			}{}%
		\draw[\PLcerclesolthick,\PLcerclecoleq] ({\PLcerclevalsin}:\PLcerclerayon)--({180-\PLcerclevalsin}:\PLcerclerayon) ;
		\filldraw[\PLcerclecoleq] ({\PLcerclevalsin}:\PLcerclerayon) circle[radius=2pt] ({180-\PLcerclevalsin}:\PLcerclerayon) circle[radius=2pt] ;%
	}
	{}
	%valeurs
	\ifboolKV[cercletrigo]{AffValeurs}
	{%
		\draw ({0.5*\PLcerclerayon},0) node[below=2pt,PLval] {$\tfrac{1}{2}$} ;
		\draw ({-0.5*\PLcerclerayon},0) node[below=2pt,PLval] {$-\tfrac{1}{2}$} ;
		\draw (0,{0.5*\PLcerclerayon}) node[left=2pt,PLval] {$\tfrac{1}{2}$} ;
		\draw (0,{-0.5*\PLcerclerayon}) node[left=2pt,PLval] {$-\tfrac{1}{2}$} ;
		\draw ({0.866*\PLcerclerayon},0) node[below=2pt,PLval] {$\tfrac{\sqrt{3}}{2}$} ;
		\draw ({-0.866*\PLcerclerayon},0) node[below=2pt,PLval] {$-\tfrac{\sqrt{3}}{2}$} ;
		\draw (0,{0.866*\PLcerclerayon}) node[left=2pt,PLval] {$\tfrac{\sqrt{3}}{2}$} ;
		\draw (0,{-0.866*\PLcerclerayon}) node[left=2pt,PLval] {$-\tfrac{\sqrt{3}}{2}$} ;
		\draw ({0.707*\PLcerclerayon},0) node[above=2pt,PLval] {$\tfrac{\sqrt{2}}{2}$} ;
		\draw ({-0.707*\PLcerclerayon},0) node[above=2pt,PLval] {$-\tfrac{\sqrt{2}}{2}$} ;
		\draw (0,{0.707*\PLcerclerayon}) node[right=2pt,PLval] {$\tfrac{\sqrt{2}}{2}$} ;
		\draw (0,{-0.707*\PLcerclerayon}) node[right=2pt,PLval] {$-\tfrac{\sqrt{2}}{2}$} ;
		%\draw[\PLcerclethick] (0,0) circle[radius=\PLcerclerayon] ; %on retrace par dessus ?
	}%
	{}
	%valeurs remarquables en dernier
	\ifboolKV[cercletrigo]{AffTraits}
	{%
		\draw[\PLcerclethick,dotted,gray] (-120:\PLcerclerayon) rectangle (60:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (-150:\PLcerclerayon) rectangle (30:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (-135:\PLcerclerayon) rectangle (45:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (-120:\PLcerclerayon)--(60:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (-150:\PLcerclerayon)--(30:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (-135:\PLcerclerayon)--(45:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (120:\PLcerclerayon)--(-60:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (150:\PLcerclerayon)--(-30:\PLcerclerayon) ;
		\draw[\PLcerclethick,dotted,gray] (135:\PLcerclerayon)--(-45:\PLcerclerayon) ;
	}%
	{}
}

%%------MESUREPPALE
\setKVdefault[MesurePpale]{%
	Crochets=false,%
	d=false,%
	Brut=false
}

\newcommand{\MesurePrincipale}[2][]{%fraction sous la forme a*pi/b ou entier :-)
	\useKVdefault[MesurePpale]%
	\setKV[MesurePpale]{#1}%
	\StrDel{#2}{pi}[\MPargument]%
	\IfBeginWith{#2}{pi}%
		{\StrSubstitute{#2}{pi}{1}[\MPargument]}%
		{}%
	\IfBeginWith{#2}{-pi}%
		{\StrSubstitute{#2}{pi}{1}[\MPargument]}%
		{}%
	%on conserve les données initiales
	\IfSubStr{\MPargument}{/}%on coupe numérateur/dénominateur
		{ \StrCut{\MPargument}{/}\MPnumerateurinit\MPdenominateurinit }%
		{ \xdef\MPnumerateurinit{\MPargument}\xdef\MPdenominateurinit{1} }%
	%on affiche le début, avant simplification
	\ifboolKV[MesurePpale]{d}%
		{\displaystyle}%
		{}%
	\xintifboolexpr{\MPdenominateurinit == 1}%
		{\ifboolKV[MesurePpale]{Brut}{}{\num{\MPnumerateurinit}\pi=}}%
		{\ifboolKV[MesurePpale]{Brut}{}{\frac{\num{\MPnumerateurinit}\pi}{\num{\MPdenominateurinit}}=}}%
	%on simplifie puis on réduit
	\xdef\MPsimpl{\xintPRaw{\xintIrr{\MPargument}}}%
	%test si l'argument est une fraction ou un entier
	\IfSubStr{\MPsimpl}{/}%
		{\StrCut{\MPsimpl}{/}\MPnumerateur\MPdenominateur}%
		{\xdef\MPnumerateur{\MPsimpl}\xdef\MPdenominateur{1}}%
	%calculs
	\xdef\MPtour{\inteval{2*\MPdenominateur}}%
	\xdef\MPreste{\xintiiRem{\MPnumerateur}{\MPtour}}%reste
	\xintifboolexpr{\MPreste>\MPdenominateur}%
		{\xdef\MPreste{\inteval{\MPreste-\MPtour}}}{}%
	\xintifboolexpr{\MPreste<-\MPdenominateur}%
		{\xdef\MPreste{\inteval{\MPreste+\MPtour}}}{}%
	%sortie suivant fraction ou non...
	\xintifboolexpr{\MPdenominateur == 1}%
	{%entier
		\xintifboolexpr{\MPreste == 1}{\pi \ifboolKV[MesurePpale]{Brut}{}{\: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)}} }{}%
		\xintifboolexpr{\MPreste == 0}{0 \ifboolKV[MesurePpale]{Brut}{}{\: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)}} }{}%
		\xintifboolexpr{\MPreste != 0 && \MPreste != 1}{\MPreste\pi \ifboolKV[MesurePpale]{Brut}{}{\: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)}} }{}%
	}%
	{%fraction
		\frac{%
			\xintifboolexpr{\xinteval{\MPreste == 1}}{}{}%
			\xintifboolexpr{\xinteval{\MPreste == -1}}{-}{}%
			\xintifboolexpr{\xinteval{abs(\MPreste) != 1}}{\num{\MPreste}}{}%
			\pi}{\num{\MPdenominateur}} \ifboolKV[MesurePpale]{Brut}{}{\: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)}}%
	}%
}

%%------LIGNES TRIGOS
\setKVdefault[Lgntrig]{%
	d=false,%
	Etapes=false
}

\newcommand\AffAngle[2][]{%semble OK
	%1 = options
	%2 = angle sous la forme a*pi/b
	\useKVdefault[Lgntrig]%
	\setKV[Lgntrig]{#1}%
	\StrDel{#2}{pi}[\MPargument]%
	\IfBeginWith{#2}{pi}%
		{\StrSubstitute{#2}{pi}{1}[\MPargument]}%
		{}%
	\IfBeginWith{#2}{-pi}%
		{\StrSubstitute{#2}{pi}{1}[\MPargument]}%
		{}%
	%on conserve les données initiales
	\IfSubStr{\MPargument}{/}%on coupe numérateur/dénominateur
		{\StrCut{\MPargument}{/}\MPnumerateurinit\MPdenominateurinit}%
		{\xdef\MPnumerateurinit{\MPargument}\xdef\MPdenominateurinit{1}}%
	%on affiche le début, avant simplification
	\ifboolKV[Lgntrig]{d}{\displaystyle}{}%
	\xintifboolexpr{\MPdenominateurinit == 1}%
		{%
			\xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
			\xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
			\xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
		}%
		{%
			\frac{%
				\xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
				\xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
				\xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
			}%
			{%
				\num{\MPdenominateurinit}%
			}%
		}%
}

\newcommand\IntSimplifMesPpale[1]{%commande interne
	\IfSubStr{#1}{pi}%
		{%
			\StrDel{#1}{pi}[\tmpargument]
			\IfBeginWith{#1}{pi}%
				{\StrSubstitute{#1}{pi}{1}[\tmpargument]}%
				{}%
			\IfBeginWith{#1}{-pi}%
				{\StrSubstitute{#1}{pi}{1}[\tmpargument]}%
				{}%
		}%
		{\def\tmpargument{#1}}%
	\IfSubStr{\tmpargument}{/}%on coupe numérateur/dénominateur
		{\StrCut{\tmpargument}{/}\MPnumerateurinit\MPdenominateurinit}%
		{\xdef\MPnumerateurinit{\tmpargument}\xdef\MPdenominateurinit{1}}%
	\xdef\MPsimpl{\xintPRaw{\xintIrr{\tmpargument}}}%
	\IfSubStr{\MPsimpl}{/}%
		{\StrCut{\MPsimpl}{/}\MPnumerateur\MPdenominateur}%
		{\xdef\MPnumerateur{\MPsimpl}\xdef\MPdenominateur{1}}%
	%calculs
	\xdef\MPtour{\inteval{2*\MPdenominateur}}%
	\xdef\MPreste{\xintiiRem{\MPnumerateur}{\MPtour}}%reste
	\xintifboolexpr{\MPreste>\MPdenominateur}%
		{\xdef\MPreste{\inteval{\MPreste-\MPtour}}}{}%
	\xintifboolexpr{\MPreste<-\MPdenominateur}%
		{\xdef\MPreste{\inteval{\MPreste+\MPtour}}}{}%
	\xdef\MPfrac{\MPreste/\MPdenominateur}%
}

\NewDocumentCommand\LigneTrigo{ s O{} m d() }{%
	%* = sans l'énoncé
	%2 = options
	%3 = ligne
	%4 = angle
	\useKVdefault[Lgntrig]%
	\setKV[Lgntrig]{#2}
	\ifboolKV[Lgntrig]{d}{\displaystyle}{}%
	\IntSimplifMesPpale{#4} %simplification du quotient et stockage dans \MPfrac
	%les cas de figure [0;pi]
	\xintifboolexpr{\MPfrac == 0}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1 }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 0 }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 0 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left(\MesurePrincipale[Brut]{#4}\right)}=}{} \frac{\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 2-\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1/6}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{3}}{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1/4}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1/3}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 5/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 2+\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1/2}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 0 }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 7/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -2-\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 2/3}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{1}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 3/4}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 5/6}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{3}}{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 11/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -2+\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1 }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 0 }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 0 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 1/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1+\sqrt{2} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 3/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1+\sqrt{2} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 5/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1-\sqrt{2} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 7/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1-\sqrt{2} }{}%
		}%
		{}%
	%cas ]-pi,0[
	\xintifboolexpr{\MPfrac == -1/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -2+\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/6}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{1}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{3}}{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/4}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/3}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -5/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -2-\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/2}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 0 }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -7/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 2+\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -2/3}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{1}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -3/4}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1 }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -5/6}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{3}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{1}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{3}}{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -11/12}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}-\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-\sqrt{6}+\sqrt{2}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 2-\sqrt{3} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1-\sqrt{2} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -3/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1-\sqrt{2} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -5/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} 1+\sqrt{2} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -7/8}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2+\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{2-\sqrt{2}}}{2} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -1+\sqrt{2} }{}%
		}%
		{}%
	%les pi/5
	\xintifboolexpr{\MPfrac == 1/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \sqrt{5-2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 2/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \sqrt{5+2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 3/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1-\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\sqrt{5+2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 4/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-1-\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\sqrt{5-2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -4/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-1-\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \sqrt{5-2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -3/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1-\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \sqrt{5+2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -2/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\sqrt{5+2\sqrt{5}} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/5}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\sqrt{5-2\sqrt{5}} }{}%
		}%
		{}%
	%les pi/10
	\xintifboolexpr{\MPfrac == 1/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{25-10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 3/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{25+10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 7/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{25+10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == 9/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{-1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{25-10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -1/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1-\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{25-10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -3/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{25+10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -7/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10-2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{1+\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{25+10\sqrt{5}}}{5} }{}%
		}%
		{}%
	\xintifboolexpr{\MPfrac == -9/10}
		{%
			\ifstrequal{#3}{cos}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\cos}{\left({\AffAngle[#2]{#4}}\right)}=}{\cos}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} -\frac{\sqrt{10+2\sqrt{5}}}{4} }{}%
			\ifstrequal{#3}{sin}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\sin}{\left({\AffAngle[#2]{#4}}\right)}=}{\sin}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{1-\sqrt{5}}{4} }{}%
			\ifstrequal{#3}{tan}%
				{\ifboolKV[Lgntrig]{Etapes}{\IfBooleanTF{#1}{}{{\tan}{\left({\AffAngle[#2]{#4}}\right)}=}{\tan}{\left({\MesurePrincipale[Brut]{#4}}\right)}=}{} \frac{\sqrt{25-10\sqrt{5}}}{5} }{}%
		}%
		{}%
}

\endinput