\documentclass{standalone}
\standaloneconfig{margin=1cm}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\definecolor{RoyalBlue}{HTML}{4169E1} % Royal Blue
\definecolor{ocre}{RGB}{243,102,25} % orange color
\definecolor{DarkGreen}{HTML}{006400} % Dark Green
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\mypi}{3.14159/1.2} % Define π
\draw[thick,black] (-7,0) -- (12,0); % Draw the main line
% Loop over intervals
\foreach \k/\mycolor in {-1/red,0/RoyalBlue,1/ocre,2/DarkGreen}{%
\pgfmathsetmacro{\start}{-1*\mypi/3 + 2*\k*\mypi} % Start of the interval
\pgfmathsetmacro{\end}{\mypi/3 + 2*\k*\mypi} % End of the interval
\pgfmathsetmacro{\mid}{(\start+\end)/2} % middle of the interval
\fill[\mycolor] ({\start},0) circle (2pt); %
\fill[\mycolor] ({\end},0) circle (2pt); %
\node[\mycolor, font=\Large] at ({\start},0) {$[$}; %
\node[\mycolor, font=\Large] at ({\end},0) {$]$}; %
\node[\mycolor, below , xshift=-0.2cm, font=\small] at ({\start},-0.3) {$\frac{-\pi}{3}+2(\k) \pi$}; %
\node[\mycolor, below , xshift=0.2cm, font=\small] at ({\end},-0.3) {$\frac{\pi}{3}+2(\k) \pi$}; %
\node[\mycolor, above] at ({\mid},0.3) {$k=\k$}; %
% Generate dashed interval points
\foreach \x in {0, 0.1, ..., 100}{ % This generates a numerical loop
\pgfmathsetmacro{\current}{\start + \x}
\ifdim \current pt<\end pt % Check if we’re still within bounds
\draw[\mycolor, thick] (\current,-0.1) -- ++(0.1,0.2);
\else
\breakforeach % Exit the loop when exceeding bounds
\fi
}
}
% Mark points
\fill ({-\mypi},0) circle (2pt); % Point at -π
\fill ({3*\mypi},0) circle (2pt); % Point at 3π
\node[above] at ({-\mypi},0) {$-\pi$};
\node[above] at ({3*\mypi},0) {$3\pi$};
\node[font=\large] at (2,2) {
$x\in]-\pi,3\pi]\quad \cos x \ge \frac{1}{2}$ \hspace*{1cm} équivalent à \hspace*{1cm}
$x\in\left[-\frac{\pi}{3}+2k\pi,\frac{\pi}{3}+2k\pi\right]$~ avec ~$k\in\mathbb Z$};
\node[font=\large] at (0,-2) {L'ensemble des solutions est l'union des intervalles inclus dans ~$]-\pi,3\pi]$~:};
\node[font=\large] at (0,-3) {$S=\left[-\frac{\pi}{3},\frac{\pi}{3}\right]\cup \left[\frac{5\pi}{3},\frac{7\pi}{3}\right]$};
\node[font=\large] at (0,-4) {Pour réduir la langueur des intervalles, j'ai redéfini $\pi=3.14159/1.2$};
\end{tikzpicture}
\end{document}
0 Comments, Latest
No comments yet. Be the first to Comment