%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		FIGURES PHYSIQUE																					%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		\PenduleSchema{}{}{}																					%
%																											%
%		\PenduleSchema{}{}{}	Première accolade = Echelle															%
%							Deuxième accolade = L Longueur du pendule en cm											%
%							Troisième accolade = H Hauteur dont le pendule est soulevé en cm 								%		
%																											%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\PenduleSchema}[3]{
\begin{tikzpicture}[scale=#1,every node/.style={transform shape}]    % Permet d'ajuster l'échelle des dessins ET du texte (node)
\draw[dashed](0,0)--(0,-6)node[below]{O}node{$\bullet$};
\draw(0,0)node[above]{C}node[above=3mm]{point de fixation}--(-120:6)node[left,pos=0.5]{\text{L = #2 cm}}node[above left]{A}
node{$\bullet$}node[below left]{$\text{m}$};
\draw(3*cos{45},-3-3*cos{45})node[above,right]{B}[thick,dotted]arc(-45:-90:3);
\draw[thick,dotted](0,-6)arc(-90:-120:6);
\draw[dashed](-4,-6)--++(8,0);
\draw[dashed](-4,-6*cos{30})--++(8,0);
\draw[latex-latex](-3.7,-6*cos{30})--node[left]{h = #3 cm}(-3.7,-6);
\node[above right] at (0,-3-3*cos{45}){H};
\end{tikzpicture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		\PenduleEnergies																						%
%																											%
%		\PenduleEnergies		Première accolade = Echelle															%
%																											%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\PenduleEnergies}{
\begin{tikzpicture}[scale=0.8,every node/.style={transform shape}]    % Permet d'ajuster l'échelle des dessins ET du texte (node) 
%Energie oscillateurs 
\draw  [->,>=latex] (0,0) --++(0,4) node [right] {E(J)}; 
\draw  [->,>=latex] (0,0) --++(10,0) node [below] {t(s)}; 
\node (O) at (0,0) [below] {0}; 
\draw[smooth,samples=100,domain=0:10,color=red,thick] plot(\x,{3.5*sin(50*\x)*sin(50*\x)}); 
\draw[smooth,samples=100,domain=0:10,color=blue,thick,dotted] plot(\x,{3.5*cos(50*\x)*cos(50*\x)}); 
\draw[smooth,samples=100,domain=0:10,color=black,dashed,thick] plot(\x,{3.5}); 
\draw(1.8,-0.05) --++ (0,0.1) node [below]{0,35}; 
\draw(3.6,-0.05) --++ (0,0.1) node [below]{0,70}; 
\draw(5.4,-0.05) --++ (0,0.1) node [below]{1,05}; 
\draw(7.2,-0.05) --++ (0,0.1) node [below]{1,40}; 
\begin{scope}[yshift=3cm,xshift=-4cm]%Décalage horizontal de 12 cm 
\draw [color=red,thick] (0,0) --++ (1,0) node [right] {Courbe 1}; 
\draw [color=blue,dotted,thick] (0,-1) --++ (1,0) node [right] {Courbe 2}; 
\draw [color=black,dashed,thick] (0,-2) --++ (1,0) node [right] {Courbe 3}; 
\end{scope} 
\end{tikzpicture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		\DiagrammeEnergetique{}{}{}{}{}{}{}{}		Attention les nodes doivent avoir des noms différents							%
%																											%		
%		\DiagrammeEnergetique{}{}{}{}{}{}{}{}		Première accolade: Echelle							 					%
%										Deuxième accolade: Réservoir d'énergie de gauche								%
%										Troisième accolade: Machine												%
%										Quatrième accolade: Réservoir d'énergie de droite								%
%										Cinquième accolade: Réservoir d'énergie du bas								%		
%										Sixième accolade: Forme d'énergie consommée								%
% 		 								Septième accolade: Forme d'énergie produite									%
%										Huitième accolade: Forme d'énergie perdue									%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\DiagrammeEnergetique}[8]{
\begin{tikzpicture}[scale=#1,every node/.style={transform shape}] 
\draw (0,0) node [draw,inner sep = 0.5 cm, thick,blue]  (#2) {#2};
\draw (5,0) node [draw,circle,thick,blue]  (#3) {#3};
\draw (10,0) node [draw,inner sep = 0.5 cm, thick,blue] (#4) {#4};
\draw (5,-4) node [draw,inner sep = 0.5 cm, thick,blue]  (#5) {#5};

\draw [->,thick,magenta] (#2)--(#3) node [midway,above,text width=2cm] {#6};
\draw [->,thick,green!50!black] (#3)--(#4) node [midway,above,text width=2cm] {#7};
\draw [->,thick,red!50!black] (#3)--(#5) node [midway,left,text width=2cm] {#8};
\end{tikzpicture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		\DiagrammeEnergetiqueVide{}																				%
%																											%		
%		\DiagrammeEnergetiqueVide{}	Première accolade: Echelle							 							%
%																											%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\DiagrammeEnergetiqueVide}[1]{
\begin{tikzpicture}[scale=#1,every node/.style={transform shape}] 
\draw (-2,0) rectangle (2,1);
\draw [->](2,0.5) -- (4,0.5);
\draw (5,0.5) circle (1);
\draw [->](6,0.5) -- (8,.5);
\draw (8,0) rectangle (12,1);
\draw [->](5,-0.5) -- (5,-2.5);
\draw (3,-3.5) rectangle (7,-2.5);
\end{tikzpicture}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		\DiagrammeEnergetiqueBasique{}																			%
%																											%		
%		\DiagrammeEnergetiqueBasique{}	Première accolade: Echelle						 							%
%																											%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\newcommand{\DiagrammeEnergetiqueBasique}[1]{
\begin{tikzpicture}[scale=#1,every node/.style={transform shape}] 
\draw [->](2,0.5) -- (4,0.5) node [midway,above] {\textbf{1}};
\draw (5,0.5) circle (1) node [inner sep = 0.5 cm] {\textbf{2}};
\draw [->](6,0.5) -- (8,.5) node [midway,above] {\textbf{3}} ;
\draw [->](5,-0.5) -- (5,-2.5) node [midway,right] {\textbf{4}};
\end{tikzpicture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%		\DiagrammeEnergetiqueChaudiere{}																			%
%																											%		
%		\DiagrammeEnergetiqueChaudière{}	Première accolade: Echelle							 						%
%																											%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\DiagrammeEnergetiqueChaudiere}[1]{
\begin{tikzpicture}[scale=#1,every node/.style={transform shape}] 
\draw (0,0) rectangle (2,2);
\draw [->](2,1) -- (4,1);
\draw (5,1) circle (1);
\draw [->](6,1) -- (8,1);
\draw (9,1) circle (1);
\draw [->](10,1) -- (12,1);
\draw (13,1) circle (1);
\draw [->](14,1) -- (16,1);
\draw (16,0) rectangle (18,2);
\draw [->](5,0) -- (5,-2);
\draw (4,-4) rectangle (6,-2);
\draw [->](9,0) -- (9,-2);
\draw (8,-4) rectangle (10,-2);
\draw [->](13,0) -- (13,-2);
\draw (12,-4) rectangle (14,-2);

\end{tikzpicture}}


