اولین بار است که به اینجا می‌آیید؟ راهنمای سایت را بخوانید!
Close Sidebar
وب‌سایت پرسش و پاسخ پارسی‌لاتک جایی برای پرسش و پاسخ درباره سیستم حروف‌چینی لاتک و بسته زی‌پرشین است. در اینجا می‌توانید سوال‌های خود را بپرسید و به سوال‌های دیگران پاسخ دهید.

محبوب‌ترین برچسب‌ها

رفع خطا جدول مراجع xepersian ریاضی‌نویسی شکل فونت فهرست مطالب شماره‌گذاری منابع bidi پانویس بیب‌تک tikz تک‌لایو parsilatex بیمر اسلاید زی‌پرشین پاورقی سربرگ bibtex نماد فرمول‌نویسی رسم شکل قالب ارجاع‌دهی biditexmaker هدر ویرایشگر beamer واژه‌نامه اندازه فونت texstudio عنوان فصل ماتریس اعمال نشدن تغییرات در پی‌دی‌اف رسم جدول bidipresentation شماره صفحه حاشیه رنگ عنوان شکل اسلاید فارسی محیط قضیه گراف مکان شکل tikzpicture حروف‌چینی کد شماره فصل enumerate tabriz_thesis نمایه align زیرنویس شکل کادر itemize listings الگوریتم عدم اجرا نیم‌فاصله متن لاتین و فارسی فهرست اشکال بسته فاصله بین خطوط قالب پایان‌نامه فرمول نصب تک‌لایو فارسی‌تک hyperref شماره فرمول glossaries کپشن نمودار حروف‌چینی چندستونی فونت فارسی و انگلیسی ماکرونویسی خروجی biditools شماره پاورقی پیوست‌ فاصله‌گذاری فرمول چندضابطه‌ای لاتک سوال امتحانی subfigure extrafootnotefeatures header texmaker pdf tex biditufte-book تصویر شمارنده texlive2015 longtable زیرنویس خطا رسم نمودار شماره‌گذاری صفحات پایان نامه دیاگرام فهرست جداول میک‌تک texlive2016 تنظیم جدول kashida texworks caption اندیس lollipop iust-thesis multicol فصل‌نویسی شعر سوال چهارگزینه‌ای بولد تورفتگی آکولاد اعداد فارسی فاصله عمودی xindy چپ‌چینی اوبونتو میکروسافت ورد قاب geometry texlive fancyhdr تک لایو 2015 عنوان بخش به‌روزرسانی بسته aimc46 صفر توخالی فرمول طولانی بیرون‌زدگی کاما وسط‌چینی tcolorbox پوستر شماره گذاری فاصله سطرها نوشتافت شکست خط tex-programming فونت اعداد pgfplots قرآن tabriz-thesis ایتالیک winedt جستجوی معکوس xelatex فلش جایابی تصویر قالب کتاب پاراگراف‌بندی بازیابی اطلاعات هایپرلینک فهرست نمادها شمارنده فصل font محیط ریاضی رسم کادر جداکننده جدول طولانی فهرست تصاویر شماره‌گذاری فرمول algorithm2e فونت بولد proof equation bidipoem eps جدول افقی عکس به‌روزرسانی پانویس چندستونی کمک مالی فاصله خطوط حروف‌چینی شعر زیرشکل minipage قلم پانویس پاراگرافی ltrfootnote پیوست computeautoilg متن فارسی و انگلیسی فرمول چندخطی neveshtuft غلط‌گیری املایی تک‌پارسی پیکان لاتکس tabular baselineskip شماره قسمت قسمت عنوان جدول
7 نفر آنلاین
0 عضو و 7 مهمان در سایت حاضرند
بازدید امروز: 9869
بازدید دیروز: 44967
بازدید کل: 21058256

رسم شکل برای تعریف انتگرال معین

+1 رای
886 بازدید

سلام، چگونه میتوان شکلهای مانند فایل پیوست برای تعریف انتگرال معین رسم کرد؟ من مثالهای زیر را دیدم و به دنبال مثالی برای رسم این شکل هستم.
http://www.texample.net/tikz/examples/area/mathematics/

آیا مثالی در این زمینه وجود داره؟ یا باید با ترکیب دستورات شکل را ایجاد کرد؟
مشکل من در ایجاد مستطیل ها و اعداد روی شکل هست.

فایل‌های پیوست
Area.JPG
سوال شده آبان 27, 1395 توسط کاوه (75 امتیاز)
برچسب گذاری دوباره آبان 29, 1395 توسط وحید دامن‌افشان

1 پاسخ

+2 رای
 
بهترین پاسخ

سلام.
امیدوارم کد زیر براتون مفید باشه:

\documentclass[10pt]{report}
\usepackage[utf8]{inputenc} 
\usepackage{amsmath}
\usepackage{color}
\usepackage{tikz}
\usepackage{pgf}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
\begin{tikzpicture}[x={(0:4)},y={(90:4)}]
% Here is your definitions...
\newcommand{\txtsize}{\tiny}% one of the following may be used here:
%\tiny  \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge
\newcommand{\func}[1]{1-(#1^2)}
%\def\n{4} % Number of splits.
\newcommand{\n}{4}
\newcommand{\numOfGrids}{4}
\pgfmathsetmacro{\gridStep}{1/\numOfGrids}
% Draw your background here...
    \path[use as bounding box] (-0.2,-0.2) rectangle (1.2,1.2);
    \path[fill=gray!20, opacity=0.3] (0,0) rectangle (1,1);
    \draw[step=\gridStep , loosely dotted] (0,0) grid (1,1);
% Draw your lines, plots, texts and so on, here...
% Here is axes...
    \draw[->] (-0.1,0) -- (1.1,0) node[right] {$x$};
    \draw[->] (0,-0.1) -- (0,1.1) node[above] {$y$};
% Here is the numbers of X and Y ...
    \foreach \i in {1,2,3,4}{
        \pgfmathsetmacro{\num}{\i*\gridStep}
        \draw (0.01,\num)--(-0.01,\num)node[left] {\txtsize$\pgfmathprintnumber[fixed, precision=2]{\num}$};
    }
% Here is the main plot $y=1-x^2$ (for this example)...
    \draw[fill=blue!10,opacity=0.1, domain=0:1,smooth, variable=\x,blue](0,0)--(0,1) plot ({\x},{1-(\x*\x)})--(0,0);
    \draw[domain=0:1,smooth, variable=\x,blue] plot ({\x},{\func{\x}});
    \node[above, blue] at (0.5,1.2) {\small $y=1-x^2$};
% Draw  your rectangles...
\pgfmathsetmacro{\nth}{1/\n}
\def\xSecond{0}
\foreach \i in {1,2,...,\n}{
    \def\xFirst{\i*\nth-\nth}
    \pgfmathsetmacro{\xSecond}{\i*\nth}
    \pgfmathsetmacro{\ySecond}{\func{\xSecond}}
    \draw[fill=red!20,opacity=0.6](\xFirst,0) rectangle(\xSecond,\ySecond);
    \draw[line width=0.5pt,draw=red](\xFirst,0) rectangle(\xSecond,\ySecond);
    \filldraw[black] (\xSecond,\ySecond)node[black, above right]{\txtsize$(\pgfmathprintnumber[fixed, precision=2]{\xSecond},\pgfmathprintnumber[fixed, precision=2]{\ySecond})$} circle(1pt);
    \draw (\xSecond,0.01)--(\xSecond,-0.01)node
%   [left , rotate=90] % USE this command instead of the above one if \n is large enough
        [below] 
    {\txtsize$\pgfmathprintnumber[fixed, precision=2]{\xSecond}$};
}
\end{tikzpicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{tikzpicture}[x={(0:4)},y={(90:4)}]
% Here is your definitions...
\newcommand{\txtsize}{\tiny}% one of the following may be used here:
%\tiny  \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge
\newcommand{\func}[1]{1-(#1^2)}
%\def\n{4} % Number of splits.
\newcommand{\n}{6}
\newcommand{\numOfGrids}{4}
\pgfmathsetmacro{\gridStep}{1/\numOfGrids}
% Draw your background here...
\path[use as bounding box] (-0.2,-0.2) rectangle (1.2,1.2);
\path[fill=gray!20, opacity=0.3] (0,0) rectangle (1,1);
\draw[step=\gridStep , loosely dotted] (0,0) grid (1,1);
% Draw your lines, plots, texts and so on, here...
% Here is axes...
\draw[->] (-0.1,0) -- (1.1,0) node[right] {$x$};
\draw[->] (0,-0.1) -- (0,1.1) node[above] {$y$};
% Here is the numbers of X and Y ...
\foreach \i in {1,2,3,4}{
    \pgfmathsetmacro{\num}{\i*\gridStep}
    \draw (0.01,\num)--(-0.01,\num)node[left] {\txtsize$\pgfmathprintnumber[fixed, precision=2]{\num}$};

}
% Here is the main plot $y=1-x^2$ (for this example)...
\draw[fill=blue!30,opacity=0.2, domain=0:1,smooth, variable=\x,blue](0,0)--(0,1) plot ({\x},{1-(\x*\x)})--(0,0);
\draw[domain=0:1,smooth, variable=\x,blue] plot ({\x},{\func{\x}});
\node[above, blue] at (0.5,1.2) {\small $y=1-x^2$};
% Draw  your rectangles...
\pgfmathsetmacro{\nth}{1/\n}
\def\xSecond{0}
\foreach \i in {1,2,...,\n}{
    \def\xFirst{\i*\nth-\nth}
    \pgfmathsetmacro{\xSecond}{\i*\nth}
    \pgfmathsetmacro{\xMid}{(\xFirst+\xSecond)/2}
    \pgfmathsetmacro{\ySecond}{\func{\xMid}}
    \draw[fill=red!20,opacity=0.6](\xFirst,0) rectangle(\xSecond,\ySecond);
    \draw[line width=0.5pt,draw=red](\xFirst,0) rectangle(\xSecond,\ySecond);
    \draw[dashed, color=red, line width=0.5 pt](\xMid,0)--(\xMid,\ySecond)node[black, above right=-0.02 ]{\txtsize$(\pgfmathprintnumber[fixed, precision=2]{\xMid},\pgfmathprintnumber[fixed, precision=2]{\ySecond})$};
    \filldraw[black] (\xMid,\ySecond) circle(1pt);
    \draw (\xMid,0)--(\xMid,-0.08)node
    [left , rotate=90]
%   [below]
    {\txtsize$\pgfmathprintnumber[fixed, precision=3]{\xMid}$};
    \draw (\xSecond,0.01)--(\xSecond,-0.01)node
        [left , rotate=90]
    %   [below] % USE this command instead of the above one if \n is small
     {\txtsize$\pgfmathprintnumber[fixed, precision=2]{\xSecond}$};
}
\end{tikzpicture}
\end{center}
\end{document}

خروجی:
enter image description here
چند پارامتر در این کد وجود دارند (مانند n یا numOfGrid یا ...) که با تغییر هریک به شکلی متناسب با آن پارامتر خواهید رسید.
پیروز و پاینده باشید.

پاسخ داده شده آبان 28, 1395 توسط حمیدرضا الهی (180 امتیاز)
انتخاب شده آبان 28, 1395 توسط کاوه
...