\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{arrows}
\usepackage{pgfplots}
%\usepackage{shortvrb}
\usepackage[top=25mm, bottom=25mm, left=25mm, right=25mm]{geometry}
\usetikzlibrary{plotmarks,positioning,shapes,arrows,backgrounds}
\usepackage{xepersian}
%\MakeShortVerb{!}
\setlatintextfont[Scale=1.2]{Yas}
\renewcommand{\baselinestretch}{1.5}

\begin{document}
\subsection*{چند مثال از بحث انتقال در \lr{Tikz}}

به‌طور کلی در \lr{Tikz} برای انتقال می‌توان از محیط \lr{scope} استفاده نمود. اکنون به ذکر چند مثال پرداخته می‌شود.
منتها قبل از آن به یک سیستم مختصات که در آن یک مثلث ترسیم شده است، توجه کنید.
\begin{center}
\begin{tikzpicture}
\draw [<->] (1,0) -- (0,0)node[left]{$(0,0)$} -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\end{tikzpicture}
 \end{center}
\begin{enumerate}
\item
انتقال افقی با استفاده از \lr{xshift}
\begin{center}
\begin{tikzpicture}
\draw [<->] (1,0) -- (0,0)node[left]{$(0,0)$} -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\begin{scope}[xshift=6cm]
\draw [<->] (1,0) -- (0,0) -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\end{scope}
\end{tikzpicture}
 \end{center}
\item
انتقال عمودی از \lr{yshift}
\begin{center}
\begin{tikzpicture}
\draw [<->] (1,0) -- (0,0)node[left]{$(0,0)$} -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\begin{scope}[yshift=-3cm]
\draw [<->] (1,0) -- (0,0) -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\end{scope}
\end{tikzpicture}
 \end{center}
\item
انتقال در افق و عمود با استفاده از \lr{xshift, yshift}
\begin{center}
\begin{tikzpicture}
\draw [<->] (1,0) -- (0,0)node[left]{$(0,0)$} -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\begin{scope}[xshift=5cm,yshift=-3cm]
\draw [<->] (1,0) -- (0,0) -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\end{scope}
\end{tikzpicture}
 \end{center}
\item
انتقال همراه با چرخش

\begin{center}
\begin{tikzpicture}
\draw [<->] (1,0) -- (0,0)node[left]{$(0,0)$} -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\begin{scope}[xshift=6cm,rotate=45]
\draw [<->] (1,0) -- (0,0) -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\end{scope}
\end{tikzpicture}
 \end{center}
\item
انتقال همراه با تغییر مقیاس
\begin{center}
\begin{tikzpicture}
\draw [<->] (1,0) -- (0,0)node[left]{$(0,0)$} -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\begin{scope}[xshift=6cm,scale=0.5]
\draw [<->] (1,0) -- (0,0) -- (0,1);
\draw[thick] (1.5,0) -- (0,2) -- (1.5,2) -- cycle;
\end{scope}
\end{tikzpicture}
 \end{center}
{\سیاه توجه:} در این حالت باید انتقال قبل از تغییر مقیاس واقع شود وگرنه فرآیند انتقال نیز دستخوش تغییر مقیاس می‌شود.
\end{enumerate}
اکنون علاوه بر بحث محیط \lr{scope} اندکی نیز از ماکرو استفاده می‌شود. ابتدا به کُد زیر توجه کنید. که شکل تقریبی یک قلب را نشان می‌دهد.
\begin{center}
\begin{tikzpicture}
\draw [scale=0.25,rotate=45,ball color=blue]
(0,0) .. controls +(0,2) and +(0,3) .. (3,0)
.. controls +(0,-2) and +(0,2) .. (0,-4)
.. controls +(0,2) and +(0,-2) .. (-3,0)
.. controls +(0,2) and +(0,2) .. (0,0);
\end{tikzpicture}
 \end{center}
اکنون  فرمان تولید قلب به کمک یک ماکرو کوچک ایجاد می‌شود و سپس با کمک آن قلب‌های مختلف ترسیم می‌گردد.
\begin{center}
\begin{tikzpicture}
% Command \coeur
\newcommand{\coeur}[1][fill=red] % Red by default
{\draw [#1] (0,0)
.. controls +(0,2) and +(0,2) .. (3,0)
.. controls +(0,-2) and +(0,2) .. (0,-4)
.. controls +(0,2) and +(0,-2) .. (-3,0)
.. controls +(0,2) and +(0,2) .. (0,0);}
% Drawing
\coeur[shift={(1.3,2)},ball color=red,scale=0.35]
\coeur[shift={(0.3,1.8)},ball color=orange,scale=0.2,rotate=35]
\coeur[shift={(2.2,1.6)},ball color=magenta,scale=0.2,rotate=-20]
\coeur[shift={(1.8,2.5)},ball color=green,scale=0.25,rotate=-25]
\coeur[shift={(2.7,2.1)},ball color=yellow,scale=0.15,rotate=10]
\end{tikzpicture}
 \end{center}
اکنون برای حس ختام به یک مثال نسبتاً مفصل‌تر توجه کنید که هم شامل محیط \lr{scope} است و ضمناً ماکرو را نیز شامل می‌شود.
\begin{center}
\begin{tikzpicture}
\shadedraw (0,0)[top color=blue, bottom color=lightgray] arc (105:75:25) -- cycle;
\fill[rotate=12] (0,0)rectangle(1,0.2);
\fill (0,0)[rotate=12,shift={(0.8,0.3)}]ellipse(0.12 and 0.25) (0,0.35)circle(0.1);
\begin{scope} [shift={(11,0.4)},rotate=-10]
\fill (0,0)--(1,0)--(1.1,0.2)--(-0.1,0.1)--cycle;
\draw[line width=2pt] (-0.2,0.4)--(0.5,0.2)--(1.2,0.4);
\fill (0,0)[shift={(0.6,0.3)}]ellipse(0.12 and 0.25) (0,0.35)circle(0.1);
\end{scope}
\newcommand{\coeur}[1][fill=red] 
{\draw [#1] (0,0)
.. controls +(0,2) and +(0,2) .. (3,0)
.. controls +(0,-2) and +(0,2) .. (0,-4)
.. controls +(0,2) and +(0,-2) .. (-3,0)
.. controls +(0,2) and +(0,2) .. (0,0);}
\coeur[shift={(1.3,2)},ball color=red,scale=0.35]
\coeur[shift={(0.3,1.8)},ball color=orange,scale=0.2,rotate=35]
\coeur[shift={(2.2,1.6)},ball color=magenta,scale=0.2,rotate=-20]
\coeur[shift={(1.8,2.5)},ball color=green,scale=0.25,rotate=-25]
\coeur[shift={(2.7,2.1)},ball color=yellow,scale=0.15,rotate=10]
\end{tikzpicture}
 \end{center}
\end{document}