Fork me on GitHub

PGF基本图形对象

 

\documentclass{article}
\usepackage[active ,tightpage ,xetex ]{ preview}
\usepackage{tikz}

\begin{document}
\begin{preview}
\begin{tikzpicture}
----------------------------------------------------------------------------------------------------------
%1 直线和矩形
\draw (0,0) --(4,0) --(2,2) --(0,0);
\draw (5,0) --(9,0) --(7,2)--cycle;
\draw [rounded corners] (10 ,0) --(14,0) --(12,2)--cycle;
\draw (15 ,0) rectangle (19 ,2);
\draw [rounded corners] (20 ,0) rectangle (24 ,2);
----------------------------------------------------------------------------------------------------------
%2 圆、椭圆、弧
\draw (1,-3) circle (1);
\draw (5,-3) ellipse (2 and 1);
\draw (10 ,-3) arc (0:270:1);
\draw (15 ,-3) arc (0:270:2 and 1);
-----------------------------------------------------------------------------------------------------------
%3 曲线
\draw (0,-6).. controls (2,-4) and (4,-4) ..(4 ,-6);
\filldraw (0,-6) circle (.1)
(2,-6) circle (.1)
(4,-4) circle (.1)
(4,-6) circle (.1);
\draw (5,-5) parabola bend (6,-6) (7.414 ,-4);
\filldraw (5,-5) circle (.1)
(6,-6) circle (.1)
(7.414 ,-6) circle (.1);
\draw (8,-6) sin (10 ,-4) cos (12 ,-6);
\filldraw (8,-6) circle (.1)
(10 ,-4) circle (.1)
(12 ,-6) circle (.1);
-----------------------------------------------------------------------------------------------------------
%4 网格
\draw [step=5pt] (0,-9) grid (3,-7);
\draw [help lines ,step=5pt] (4,-9) grid (7,-7);
-----------------------------------------------------------------------------------------------------------
\end{tikzpicture}
\end{preview}
\end{document}

 

posted @ 2014-11-21 12:25  小奔奔  阅读(146)  评论(0编辑  收藏  举报