www.number.890m.com
Desenhando no LATEXcom Tikz
Apesar de uma extensa documentação sobre Latex e o pacote Tikz,
disponível na internet, a maior parte está em língua estrangeira, trata
apenas do básico ou são apenas cópia de outras cópias. Para equi-
librar um pouco a balança essa apostila (em língua portuguesa) traz
o que há de mais importante para que você seja capaz de criar seus
próprios desenhos vetoriais com a linguagem Latex.
2
Sumário
1 O QUE É O TIKZ 5
1.1 O TIKZEDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 O QTIKZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 O GEOGEBRA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 SEGMENTO 9
3.1 ATRIBUTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 ARESTAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 RETÂNGULO 13
6 SETAS 16
7 COORDENADA POLAR 18
8 GRADE (Grid) 18
9 COR 19
10 FILL E FILLDRAW 21
10.1 SHADE (GRADIANTE) . . . . . . . . . . . . . . . . . . . . . . . . . 22
11 OPACITY 25
12 NODE (LEGENDAS) 26
13 FOREACH (REPETIÇÃO) 27
14 FUNÇÕES 29
15 CURVAS NO TIKZ 30
15.1 PARÁBOLAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
15.2 ROUNDED CORNERS . . . . . . . . . . . . . . . . . . . . . . . . . 30
15.3 O TO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
15.4 SMOOTH E TENSION . . . . . . . . . . . . . . . . . . . . . . . . . 32
15.5 BÉZIER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
16 COORINATE 35
17 TRANSFORMAÇÕES GEOMÉTRICAS 36
17.1 XSHIFT E O YSHIFT . . . . . . . . . . . . . . . . . . . . . . . . . . 36
17.2 ESPELHAMENTO . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
17.3 ROTAÇÃO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
17.4 ESCALAMENTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
17.5 O AMBIENTE SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . 38
18 CLIP 41
19 REFERÊNCIA 43
4
1 O QUE É O TIKZ
http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language
1.1 O TIKZEDT
O TikzEdt é o programa
mais completo que se pode
achar atualmente. Mas, in-
felizmente, só se encontra
disponível para Windows e não
funciona bem emulado com o
Wine. Também não está em
sua versão final e como é um
projeto desenvolvido pela co-
munidade ainda está em sua
versão beta e não sairá dela
tão cedo. Além disso pos-
sui alguns problemas que po-
dem acarretar em seu mau fun-
cionamento.
1.2 O QTIKZ
5
1.3 O GEOGEBRA
Você pode usar o Geoge-
bra para gerar algum código
em latex, embora isso seja
pouco recomendável. Por ex-
emplo: abra o Geogebra e
desenhe um círculo de raio
igual a um. Em seguida vá
no menu: Arquivo > Expor-
tar > Janela de Visualização
como PGF/Tikz. Irá aparecer
a seguinte janela.
6
do código e sempre escreve li- serem utilizadas em outros pro-
nhas desnecessárias que podem gramas.
necessitar serem apagadas para
7
2 USANDO O TIKZ NO TEXMAKER
8
3 SEGMENTO
\begin{tikzpicture}
\draw(0,0)--(4,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw(0,0) -- (1,2) -- (2,3)
--(1,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw(1, 2)--++(1, 1);
\end{tikzpicture}
\begin{tikzpicture}
\draw(1, 2)--(2, 3);
\end{tikzpicture}
9
\begin{tikzpicture}
%Reta formado pelos pontos
(6,0); (11,0.5) e (6,1)
\draw(6,0)--++(5,0.5)
--++(-5,0.5);
\end{tikzpicture}
\begin{tikzpicture}
\draw(0,0)--(1,0)(0,.5)
--(1,.5)(0,1)--(1,1);
\end{tikzpicture}
Ele é equivalente a:
\begin{tikzpicture}
\draw(0,0)--(1,0);
\draw(0,.5)--(1,.5);
\draw(0,1)--(1,1);
\end{tikzpicture}
3.1 ATRIBUTOS
• A espessura;
• a cor;
• e o estilo.
\begin{tikzpicture}
\draw [line width=10pt, color
= red](0,0)--(4,0);
\end{tikzpicture}
10
A ordem com que os atributos são informados não faz a menor
diferença, desde que colocados entre vírgula.
\begin{tikzpicture}
\draw [line width=.5cm](0,1)
--(4,1);
\draw [line width=2ex](0,0)
--(4,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw [red](0,0)--(4,0);
\end{tikzpicture}
São dois os estilos de seguimento que uma linha pode ter. Esses
estilos são o: dotted (pontilhado) e o dashed (tracejado) e o dash
pattern (tracejado controlado).
\begin{tikzpicture}
\draw[dotted](0,2)--(4,2);
\draw[dashed](0,1)--(4,1);
\end{tikzpicture}
\begin{tikzpicture}
\draw[dash pattern=on 1pt off
2pt on 5pt off 4pt] (0,1)
--(4,1);
11
Na primeira linha 15pt é o tamanho do traço enquanto 5pt é o
espaço entre eles. Na segunda linha temos dois tipos de tracejado,
por isso, temos quatro medidas separadas (duas a duas) por “on".
3.2 ARESTAS
\begin{tikzpicture}[line width
=5pt]
\draw(6,0)--(11,.5)--(6,1);
\end{tikzpicture}
\begin{tikzpicture}
\draw[miter limit=25, line
width=5pt](6,0)--++(5,0.5)
--++(-5,0.5);
\end{tikzpicture}
12
4 RETÂNGULO
\begin{tikzpicture}
\draw(0,0)rectangle(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw(1.5,1)rectangle++(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw(1.5,1)rectangle(3.5,3);
\end{tikzpicture}
13
5 CIRCUNFERÊNCIAS, ELIPSES E ARCOS
\begin{tikzpicture}
% Circunferencia de raio 0.5
cm e centro em (0,0)
\draw(0,0)circle(0.5cm);
% Centro em (2,0) e raio de 1
rad.
\draw (2,0) circle [radius=1];
\end{tikzpicture}
1.5cm 0.5cm
\begin{tikzpicture}
% Elipse:
\draw(1,1)ellipse(1.5cm and
0.5cm);
\end{tikzpicture}
\begin{tikzpicture}
% Arco
\draw(6,0) arc [radius=3cm,
start angle=0, end angle=
75];
\end{tikzpicture}
Para que você visualize melhor o que está sendo dito observe o
mesmo arco desenhado sob uma grade marcada e com origem no
ciclo trigonométrico.
14
90◦
60◦
45◦
30◦
0◦
(0,0) (3,0)
\begin{tikzpicture}
% Ao inves de [radius=3cm,
start angle=0, end angle=
75]
\draw(6,0)arc(0:75:3cm);
\end{tikzpicture}
\begin{tikzpicture}
% Arco invertido
\draw [red](3,0) arc (0:-75:-3
cm);
\end{tikzpicture}
\begin{tikzpicture}
% Arco no sentido anti-horario
\draw[blue] (3,0) arc (0:75:-3
cm);
\end{tikzpicture}
15
6 SETAS
% Seta dupla
\begin{tikzpicture}
\draw [<->] (3,0)--(4,0);
\end{tikzpicture}
\begin{tikzpicture}
% Arco setado
\draw [line width=3pt, ->
](3,0) arc (0:-75:-3cm);
\end{tikzpicture}
\begin{tikzpicture}
\draw [line width=2pt,
|->](0,0)--(2,0);
\end{tikzpicture}
16
\begin{tikzpicture}
\draw[line width=2pt, dotted,
>->>](0,0)--(2,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw[line width=2pt,
|<->|](0,0)--(2,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw[line width=2pt, dashed,
o-)](0,0)--(2,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw[line width=2pt, loosely
dashed](0,0)--(2,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw[line width=2pt, densely
dotted](0,0)--(2,0);
\end{tikzpicture}
17
7 COORDENADA POLAR
\begin{tikzpicture}
% Coordenada Polar
\draw(0,0)--++(45:2);
\end{tikzpicture}
\begin{tikzpicture}
\filldraw[fill=yellow, draw=
black](0,0)--++(45:1)arc
(45:360:1cm)--cycle;
\filldraw[fill=white, draw=
black](-0.2,.5)circle(.1cm
);
\end{tikzpicture}
8 GRADE (Grid)
\begin{tikzpicture}
\draw[step=1cm](-1,-1)grid
(3,3);
\end{tikzpicture}
18
\begin{tikzpicture}
% grade pontilhada
\draw[dash pattern=on 3pt off
3pt, step=1cm](-0.9,-0.9)
grid(2.9,2.9);
\end{tikzpicture}
\begin{tikzpicture}
\draw[xstep=1, ystep
=.5](-1,-1)grid(3,3);
\end{tikzpicture}
9 COR
Cyan Lightgray
Pink Yellow
Orange Violet
Brown Purple
Blue Magenta
Black Green
Red Gray
Para usar qualquer uma destas cores basta escreve-la como atri-
buto do draw. Veja o exemplo.
19
\begin{tikzpicture}
\draw[red](0,0)rectangle
++(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw[red!50!green, line width
= 3pt](0,0)rectangle
++(2,2);
\end{tikzpicture}
20
10 FILL E FILLDRAW
\begin{tikzpicture}
% Desenha o contorno do
retangulo
\draw[cyan](0,0)rectangle(2,2)
;
\end{tikzpicture}
\begin{tikzpicture}
% Pinta o retangulo sem
contorno
\fill[cyan](0,0)rectangle(2,2)
;
\end{tikzpicture}
\begin{tikzpicture}
% Desenha o contorno do
retangulo e pinta seu
interior
\filldraw[fill=cyan, draw=
black](0,0)rectangle(2,2);
\end{tikzpicture}
21
10.1 SHADE (GRADIANTE)
\begin{tikzpicture}
\shade[left color=blue, right
color=red](0,0)rectangle
(4,4);
\end{tikzpicture}
\begin{tikzpicture}
\shade[top color=blue, bottom
color=red](0,0)rectangle
(4,4);
\end{tikzpicture}
\begin{tikzpicture}
\shade[inner color=blue, outer
color=red](0,0)rectangle
(4,4);
\end{tikzpicture}
22
\begin{tikzpicture}
\shade[shading=ball, ball
color=blue] (0,0) circle
(2);
\end{tikzpicture}
\begin{tikzpicture}
\fill[left color=blue, right
color=red](0,0)rectangle
(4,4);
\end{tikzpicture}
\begin{tikzpicture}
% Em cima e em baixo
\fill[top color=blue, bottom
color=red](0,0)rectangle
(4,4);
\end{tikzpicture}
\begin{tikzpicture}
% No centro
\fill[inner color=blue, outer
color=red](0,0)rectangle
(4,4);
\end{tikzpicture}
23
\begin{tikzpicture}
\fill[shading=ball, ball color
=blue] (0,0) circle (2);
\end{tikzpicture}
24
11 OPACITY
\begin{tikzpicture}
\filldraw[fill=red, opacity
=0.5] (0:1cm) circle (12mm
);
\filldraw[fill=green, opacity
=0.5] (120:1cm) circle (12
mm);
\filldraw[fill=blue, opacity
=0.5] (-120:1cm) circle
(12mm);
\end{tikzpicture}
25
12 NODE (LEGENDAS)
\begin{tikzpicture}
Legenda % Escrita normal
\draw(0,0)node{Legenda};
\begin{tikzpicture}
% Legenda abaixo do ponto
\fill(0,3)circle(0.05cm)node[
D
above]{D};
% Legenda acima do ponto
\fill(0,2)circle(0.05cm)node[
C below]{C};
% Legenda a direita do ponto
B \fill(0,1)circle(0.05cm)node[
right]{B};
% Legenda a esquerda do ponto
A \fill(0,0)circle(0.05cm)node[
left]{A};
\end{tikzpicture}
\begin{tikzpicture}
% Texto
2
\draw[red](0,0)node{Legenda};
8 % Equacao
\draw(0,1)node{$\dfrac{a
Legenda ^2}{8}$};
\end{tikzpicture}
26
13 FOREACH (REPETIÇÃO)
\begin{tikzpicture}
\foreach \x in {0,1,2,3,4}
\draw(\x cm,1)--(\x cm,-1);
\end{tikzpicture}
A primeira linha
\foreach \x in {0,1,2,3,4}
cria uma variável “x" igual a zero e indica que todos os comandos
escritos após ele, e que possuem a variável “x", serão repetidos 5
vezes. Na primeira vez o “x" será igual a 0, depois 1 até chegar ao 4.
\begin{tikzpicture}
\draw(0,1)--(0,-1);
\draw(1,1)--(1,-1);
\draw(2,1)--(2,-1);
\draw(3,1)--(3,-1);
\draw(4,1)--(4,-1);
\end{tikzpicture}
\begin{tikzpicture}
\foreach \x in {0,1,2,3,4}
\draw(\x cm,1)--(\x cm,-1)node
[below]{\x};
\end{tikzpicture}
0 1 2 3 4
27
\begin{tikzpicture}
\draw[->] (-5.5,0) -- (0,0)
node [right] {$\mathbb{R
R }$};
-5 -4 -3 -2 -1 0 \foreach \x in {-5,...,0}
\draw (\x, 0.1) -- (\x, -0.1)
node [below] {\x};
\end{tikzpicture}
\begin{tikzpicture}
\foreach \x in {1,2,3}
\shade[ball color=red!\x 0!
green] (\x,0) circle (3mm)
;
\end{tikzpicture}
\begin{tikzpicture}
\foreach \x in {9,...,1}
\draw[fill=blue!\x0] (-0.1*\x
- 1, -0.1*\x )
rectangle (0.1*\x + 1, 0.1*\x
);
\end{tikzpicture}
28
14 FUNÇÕES
% grafico de funcao
\begin{tikzpicture}
\draw[->](-3,0)--(3,0);
\draw[->](0,-1)--(0,4);
% Plotagem de -2 a 0
\draw[blue,domain=-2:0]plot(\x
,{(\x)^2});
% Plotagem de 0 a 2
\draw[blue,domain=0:2]plot(\x
,{\x^2});
\end{tikzpicture}
factorial(\x)
sqrt(\x) Raiz quadrada.
pow(\x,y) O mesmo que y .
exp(\x) O mesmo que e .
ln(\x) Logaritmo natural.
log10(\x)
log2(\x)
abs(\x) Valor absoluto.
mod(\x,y) Divisão inteira de x por y.
round(\x) Arredondamento.
floor(\x) Inteiro mais próximo.
ceil(\x) Menor numero maior que x.
sin(\x) Seno expresso em graus.
sin(\x r) Seno expresso em radiano.
cos(\x) Cosseno expresso em graus.
cos(\x r) Cosseno expresso em radianos.
tan(\x) Tangente expressa em graus.
tan(\x r) Tangente expressa em radianos.
29
15 CURVAS NO TIKZ
15.1 PARÁBOLAS
\begin{tikzpicture}
\draw(0,0)parabola(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw(0,0)parabola++(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw(0,0)rectangle++(2,2);
\draw[rounded corners=0.5cm
](2.5,0)rectangle++(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw(0,0)rectangle++(1,1);
\draw[rounded corners=0.1cm
](2,0)rectangle++(1,1);
\draw[rounded corners=.5cm
](4,0)rectangle++(1,1);
\end{tikzpicture}
30
15.3 O TO
\begin{tikzpicture}
% Reta
\draw(0,0)to(2,3);
\end{tikzpicture}
\begin{tikzpicture}
\draw(3,0) to[out=90,in=180]
(5,3);
\end{tikzpicture}
31
\begin{tikzpicture}
\draw[blue](0,0)to[out=90,in
=225](1,2)to[out=-45,in
=90](2,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw[smooth] plot coordinates
{(0,0)(1,1)(2,0)(3,1)};
\draw[dashed,color=gray](0,0)
--(1,1)--(2,0)--(3,1);
\end{tikzpicture}
\begin{tikzpicture}
\draw[smooth, tension=1] plot
coordinates{(0,0)(1,1)
(2,0)(3,1)};
\draw[dashed,color=gray](0,0)
--(1,1)--(2,0)--(3,1);
\end{tikzpicture}
32
15.5 BÉZIER
Sintaxe:
\draw(x0, y0)..controls(x1,y1)and(x2,y2)..(y3,x3);
(8, −0.1)
(9, −0.5)
(6, −1)
(5, −2)
\begin{tikzpicture}
\draw[red](5,-2)..controls
(6,-1)and(8,-0.1)
..(9,-0.5);
\end{tikzpicture}
33
\begin{tikzpicture}
% Grade
\draw[opacity=0.1, step
=.1](0,0)grid(2,8.4);
% Eixo de simetria
\draw[red](0,0)--++(0,8.4);
% Taca
\draw(0,0)--(1.4,0);
\draw[blue](1.4,0)..controls
(1.4,0)and(1.9,0)
..(1.9,.2).. controls
(1.9,.3)and(1.6,.2)
..(1.5,.2)..controls
(1.3,.2)and(.2,.7)
..(.2,1.1)--(.2,3.5)..
controls(1,4)and(2.3,5.0)
.. (1.5,8.3);
\draw(1.5,8.3)--(0,8.3);
\end{tikzpicture}
34
16 COORINATE
Sintase:
\coordinate[legenda](Nome do ponto)at(x,y);
Veja um exemplo.
\begin{tikzpicture}
% Grade
\draw[step=1cm,gray](-1,-1)
grid(3,3);
% Ponto A
C
\coordinate(A)at(0,0);
% Ponto B com legenda a
B esquerda
\coordinate[label=left:B](B)at
(1.5,1);
% Ponto C com legenda a
direita
\coordinate[label=right:C](C)
at(2,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw[step=1cm, gray](-1,-1)
grid(3,3);
C
\coordinate(A)at(0,0);
\coordinate[label=left:B](B)at
B (1.5,1);
\coordinate[label=right:C](C)
at(2,2);
% Reta
\draw(A)--(B)--(C);
\end{tikzpicture}
35
17 TRANSFORMAÇÕES GEOMÉTRICAS
\begin{tikzpicture}
% Grade
\draw[color=lightgray](-1,-1)
grid(3,3);
% Triangulo
\draw(1,1)--(2,1)--(1.5,2)--
cycle;
% Deslocado 1cm p/ direita e p
/ cima
\draw[xshift=1cm, yshift=1cm
](1,1)--(2,1)--(1.5,2)--
cycle;
\end{tikzpicture}
17.2 ESPELHAMENTO
Você pode espelhar um ponto, em relação a coordenada (0,0),
multiplicando as coordenadas dos pontos por -1.
\begin{tikzpicture}
% Grade
\draw[color=lightgray](-2,-2)
grid(2,2);
\fill[red](0,0)circle(0.2cm);
% Triangulo
\draw(1,1)--(2,1)--(1.5,2)--
cycle;
% Espelhado 1cm p/ esquerda e
p/ baixo
\draw[x=-1cm, y=-1cm](1,1)
--(2,1)--(1.5,2)--cycle;
\end{tikzpicture}
17.3 ROTAÇÃO
36
\begin{tikzpicture}
% rotacao de 30 graus
\draw[rotate=30](0,0)rectangle
(1,0.5);
% 90 graus
\draw[rotate=90](0,0)rectangle
(1,0.5);
% 120 graus
\draw[rotate=120](0,0)
rectangle(1,0.5);
\end{tikzpicture}
17.4 ESCALAMENTO
\begin{tikzpicture}
% Figura com dimensoes normais
\draw (0,0)--(1,0)--(0.5,1)--
cycle;
\end{tikzpicture}
\begin{tikzpicture}[scale=2]
% Figura ampliada duas vezes
\draw(0,0)--(1,0)--(0.5,1)--
cycle;
\end{tikzpicture}
\begin{tikzpicture}
% Figura reduzida pela metade
\draw[scale=.5](0,0)--(1,0)
--(0.5,1)--cycle;
\end{tikzpicture}
\begin{tikzpicture}
% Triangulo
\draw(0,0)--(1,0)--(0.5,1)--
cycle;
% Triangulo ampliado 2 vezes
\draw[x=2cm, y=2cm](0,0)
--(1,0)--(0.5,1)--cycle;
\end{tikzpicture}
37
A diferença entre uma forma ou outra é que a segunda não am-
plia realmente as imagens e sim as distâncias entre os pontos. Não
confunda!
\begin{tikzpicture}
% Circulo ampliado 2 vezes
\draw[scale=2](0,0)circle(1.cm
);
% Quadrado ampliado 2 vezes
\draw[scale=2](1,0)rectangle
(2,1);
\end{tikzpicture}
\begin{tikzpicture}
% Circulo original
\draw(0,0)circle(1.cm);
% Quadrado original
\draw(1,0)rectangle(2,1);
\end{tikzpicture}
\begin{tikzpicture}[scale=2]
% Circulo ampliado 2 vezes
\draw(0,0)circle(1.cm);
% Quadrado ampliado 2 vezes
\draw(1,0)rectangle(2,1);
\end{tikzpicture}
38
usar dois ou mais scoopes em um mesmo ambiente tikz) e realizar
alterações específicas neles.
\begin{tikzpicture}
% Grade
\draw[opacity=0.1,step
=.1](0,0)grid(2,8.4);
% Eixo de simetria
\draw[red](0,0)--++(0,8.4);
% taca
\draw(0,0)--(1.4,0);
\draw[blue](1.4,0)..controls
(1.4,0)and(1.9,0)
..(1.9,.2).. controls
(1.9,.3)and(1.6,.2)
..(1.5,.2)..controls
(1.3,.2)and(.2,.7)
..(.2,1.1)--(.2,3.5)..
controls(1,4)and(2.3,5.0)
..(1.5,8.3);
\draw(1.5,8.3)--(0,8.3);
\end{tikzpicture}
39
\begin{tikzpicture}
% Grade
\draw[opacity=0.1,step
=.1](0,0)grid(2,8.4);
% Eixo de simetria
\draw[red](0,0)--++(0,8.4);
% taca
\draw(0,0)--(1.4,0);
\draw[blue](1.4,0)..controls
(1.4,0)and(1.9,0)
..(1.9,.2).. controls
(1.9,.3)and(1.6,.2)
..(1.5,.2)..controls
(1.3,.2)and(.2,.7)
..(.2,1.1)--(.2,3.5)..
controls(1,4)and(2.3,5.0)
..(1.5,8.3);
\draw(1.5,8.3)--(0,8.3);
% Reflexao
\begin{scope}[x=-1cm]
\draw(0,0)--(1.4,0);
\draw(1.4,0)..controls(1.4,0)
and(1.9,0)..(1.9,.2)..
controls (1.9,.3)and
(1.6,.2)..(1.5,.2)..
controls(1.3,.2)and(.2,.7)
..(.2,1.1)--(.2,3.5)..
controls(1,4)and(2.3,5.0)
..(1.5,8.3);
\draw(1.5,8.3)--(0,8.3);
\end{scope}
\end{tikzpicture}
40
\begin{tikzpicture}
% retangulo negro
\draw[step=.5, lightgray](0,0)
grid(3,2);
\draw (0,0) rectangle (1,0.5);
% Scope
\begin{scope}[xshift=2cm, red]
% retangulo deslocado 2cm a
direita
\draw(0,0)rectangle(1,0.5);
\end{scope}
\end{tikzpicture}
18 CLIP
\begin{tikzpicture}[scale=2]
\draw[step=.5cm, gray
](-1.4,-1.4)grid(1.4,1.4);
\draw(-1.5,0)--(1.5,0);
\draw(0,-1.5)--(0,1.5);
\draw(0,0)circle(1cm);
\shadedraw[left color=gray,
right color=green, draw=
green!50!black](0,0)--(3mm
,0mm)arc(0:30:3mm)--cycle;
\end{tikzpicture}
41
\begin{tikzpicture}[scale=2]
\clip(-.1,-.2)rectangle
(1.1,.75);
\draw[step=.5cm, gray](-1.4,
-1.4)grid(1.4, 1.4);
\draw(-1.5, 0)--(1.5, 0);
\draw(0, -1.5)--(0, 1.5);
\draw(0, 0)circle(1cm);
\shadedraw[left color=gray,
right color=green, draw=
green!50!black](0, 0)--(3
mm, 0mm)arc(0:30:3mm)--
cycle;
\end{tikzpicture}
42
19 REFERÊNCIA
TANTAU, Até Till. TIKZ and PGF: Manual for version 1.18. 12
June 2007.
43