Colorer une région du plan Crée par une droite

📅 06 May 2024 👁️ المشاهدات: 146


📘 نبذة عن الدرس

📄 ماذا ستجد في هذه الصفحة؟

• ملف الدرس بصيغة PDF يمكنك معاينته هنا مباشرةً دون تنزيله.

• يمكنك تنزيل الملف من زر التحميل أسفل الصفحة والاحتفاظ به على جهازك.

• ستجد أيضًا دروسًا وامتحانات وتمارين ذات صلة تساعدك على المراجعة وتعميق الفهم.

• أُدرج مصدر LaTeX الكامل أسفل الصفحة لتتمكن من الاطلاع عليه أو تعديله والاستفادة منه.

• هل تحتاج تنسيقًا احترافيًا لموادك الخاصة؟ أقدم خدمة كتابة LaTeX — أرسل المحتوى المطلوب لتحصل على ملف PDF منسق وملف المصدر.

معاينة ملف الدرس لمادة latex، المستوى figures

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{intersections}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
        xmin=-5, xmax=5,
        ymin=-5, ymax=5,
        axis lines=middle,
        xlabel={$x$},
        ylabel={$y$},
        xtick={-4,-2,...,4},
        ytick={-4,-2,...,4},
        grid=both,
    ]
        % Define the function
        \addplot[domain=-5:5.5, smooth, red, name path=curve] {(1 - x)/2};

        % Find intersection with the top-most point on the left
        \path[name path=laxis] (axis cs:-5,-5) -- (axis cs:-5,5); % axis x=-5
        \path[name intersections={of=curve and laxis,by={A}}];

        % Find intersection with the bottom-most point on the right
        \path[name path=raxis] (axis cs:5,-5) -- (axis cs:5,5); % axis x=5
        \path[name intersections={of=curve and raxis,by={B}}];

        % Define the bottom-left corner of our domain
        \coordinate (C) at (axis cs:-5,-5);
        % Define the bottom-right corner of our domain
        \coordinate (D) at (axis cs:5,-5);

        % Fill the region below the curve
        \fill[blue!20, opacity=0.6] (A) -- (B) -- (D) -- (C) -- cycle;

        % Plot the points A, B, and C
        \fill (A) circle (1pt) node[left] {A};
        \fill (B) circle (1pt) node[right] {B};
        \fill (C) circle (1pt) node[below left] {C};
    \end{axis}
\end{tikzpicture}

\end{document}

Comme le régionnement du plan est facile à Créer en utilisant GeoGebra, je conseil de l'utiliser pour générer une figure comme cette figure


\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{intersections}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
        xmin=-5, xmax=5,
        ymin=-5, ymax=5,
        axis lines=middle,
        xlabel={$x$},
        ylabel={$y$},
        xtick={-4,-2,...,4},
        ytick={-4,-2,...,4},
        grid=both,
    ]
        % Define the function
        \addplot[domain=-5:5.5, smooth, red, name path=curve] {(1 - x)/2};

        % Find intersection with the top-most point on the left
        \path[name path=laxis] (axis cs:-5,-5) -- (axis cs:-5,5); % axis x=-5
        \path[name intersections={of=curve and laxis,by={A}}];

        % Find intersection with the bottom-most point on the right
        \path[name path=raxis] (axis cs:5,-5) -- (axis cs:5,5); % axis x=5
        \path[name intersections={of=curve and raxis,by={B}}];

        % Define the bottom-left corner of our domain
        \coordinate (C) at (axis cs:-5,-5);
        % Define the bottom-right corner of our domain
        \coordinate (D) at (axis cs:5,-5);

        % Fill the region below the curve
        \fill[blue!20, opacity=0.6] (A) -- (B) -- (D) -- (C) -- cycle;

        % Plot the points A, B, and C
        \fill (A) circle (1pt) node[left] {A};
        \fill (B) circle (1pt) node[right] {B};
        \fill (C) circle (1pt) node[below left] {C};
    \end{axis}
\end{tikzpicture}

\end{document}


📂 تصفّح جميع موارد مادة latex للمستوى figures

موارد ذات صلة: دروس وامتحانات وتمارين



يمكنك الاطلاع على المزيد من موارد latex للمستوى figures.

اترك تعليقًا

الحد الأقصى 5000 حرف.