Sunday, December 4, 2011

Some basic graph objects in pstricks (3) ---- Circles,Arc,Wedge,Ellipses,Elliptic Arc,Rectangle and so on

"\pscircle[parameters](x0,y0){r}" draws a circle whose center is located at (x0,y0) and that has radius r.

"\pswedge[parameters](x0,y0){r}{ang1}{ang2}" draws a wedge whose center is located at (x0,y0), that has radius r and extened counterclockwise from ang1 to ang2.

"\psarc[parameters]{arrowstyle}(x,y){r}{angA}{angB}" clockwisely draws an arc form angA to angB. (x,y) and r are the center and radius of the circle ( a arc curve is always a part of a circle).

"\psellipse[parameters](x0,y0)(h_r,v_r)" draws a ellipse. (x0,y0) is the center, h_r is the horizontal radius and v_r is the vertical radius.

"\psellipticarc[par]{arrow}(x0,y0)(x1,y1){angA}{angB}" which is very similar to "\psarc" draws an elliptic.

"\psframe[parameters](x0,y0)(x1,y1)" draws a rectangle with lower left corner at (xo,y0), upper right corner at (x1,y1).

There are also command like "\pstriangle","\psdiamond" to draw triangle and diamond. But we can use "\pspolygon" to realize the utility of all these commands. So we will not talk about them here.

For all these commands a star can be followed (for example, "\pscircle*"). This determine the fill the object.

Now let we have a practice on these commands.


\documentclass{article}
\usepackage{pstricks}
\begin{document}
  \begin{pspicture}(-2.5,2.5)(2.5,2.5)
    \psframe[linestyle=none,framearc=0.25,%
      fillstyle=solid,fillcolor=green]
      (-2.5,-2.5)(2.5,2.5)
    \pscircle[linecolor=red](0,0){2.5}
    \pswedge[fillstyle=solid,
      fillcolor=red](0,0){2.5}{0}{45}
    \psarc{->}(0,0){1.5}{0}{45} %draw arc
    \uput{1.5}[22.5]
      (0,0){$45^{\circ}$} %put a label
    \psellipse(0,-1.25)(2.5,1.25)
  \end{pspicture}
\end{document}

This practice draw something like this:

Fig.1 Draw circle,arc,ellipse,rectangle... uisng Pstricks
 Files download: tex ps pdf

1 comment:

Creative Commons License
Except as otherwise noted, the content of this page is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.