pstricks - open computing facilitylatex/f09/homeworks/week6/beamer_… · polygons curves formulas...
Post on 11-Aug-2020
4 Views
Preview:
TRANSCRIPT
OutlineLines
PolygonsCurves
PSTricks
Evelyn Crofts
week11
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
LinesFormulasExamples
PolygonsFormulasExamples
CurvesBezier CurvesParabolasTwo More Curves
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
What is PSTricks?
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
What is PSTricks?
◮ A Package for making images.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
What is PSTricks?
◮ A Package for making images.◮ Most useful for polygons, lines, etc. But it can get pretty
fancy.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
What is PSTricks?
◮ A Package for making images.◮ Most useful for polygons, lines, etc. But it can get pretty
fancy.◮ As the name tries to tell you most forcefully, this needs to
compile into PS! TeXnicCenter also has a LaTeX ⇒ PS ⇒PDF compiler.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Lines\ psline[par]arrows(x0,y0)(x1,y1)(xn,yn)This draws a line through the list of coordinates. Someparameters are
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Lines\ psline[par]arrows(x0,y0)(x1,y1)(xn,yn)This draws a line through the list of coordinates. Someparameters are
1. linewidth=(num)(units) (Default .8pt)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Lines\ psline[par]arrows(x0,y0)(x1,y1)(xn,yn)This draws a line through the list of coordinates. Someparameters are
1. linewidth=(num)(units) (Default .8pt)
2. linearc=(num) (Default 0)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Lines\ psline[par]arrows(x0,y0)(x1,y1)(xn,yn)This draws a line through the list of coordinates. Someparameters are
1. linewidth=(num)(units) (Default .8pt)
2. linearc=(num) (Default 0)
3. linecolor=(num)(units)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Lines\ psline[par]arrows(x0,y0)(x1,y1)(xn,yn)This draws a line through the list of coordinates. Someparameters are
1. linewidth=(num)(units) (Default .8pt)
2. linearc=(num) (Default 0)
3. linecolor=(num)(units)
4. showpoints=true/false
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
The following is defined by this command\psline[linewidth=2pt,linearc=.25]{->}(4,0)(0,-1)(2,-2)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
(0,0) is set to be Latex’s current position. So, if you forget todouble space after your text, you will get an image that mayoverlap. For example\psline[linewidth=2pt,linearc=.25]{->}(1,0)(3,2)(2,0)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Another thing to look out for is that these graphics do not havea defined space in which they live. This means that text after agraphic will also overlap it unless you include a command tomove the text lower or to one side. You may use (for example)\vspace{1in} to add the space that the picture takes up.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Some more examples:\psline[linewidth=2pt,linecolor=blue]{-}(0,0)(.5,-1)(1,0)(1.5,-1)(2,0)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Some more examples:\psline[linewidth=2pt,linecolor=blue]{-}(0,0)(.5,-1)(1,0)(1.5,-1)(2,0)\psline[linewidth=.8pt,linearc=.1,linecolor=magenta]{<->}(5,0)(4.5,-1)(5.5,-1)(5.1,0)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Some more examples:\psline[linewidth=2pt,linecolor=blue]{-}(0,0)(.5,-1)(1,0)(1.5,-1)(2,0)\psline[linewidth=.8pt,linearc=.1,linecolor=magenta]{<->}(5,0)(4.5,-1)(5.5,-1)(5.1,0)
\psline[showpoints=true, linecolor=green]
{-}(8,0)(9,0)(10,-.5)(11,0)
b b
b
b
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Polygons
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
Polygons are similar to lines, but the path is automaticallyclosed. The general form is\pspolygon[par](x0,y0)(x1,y1)(x2,y2)(xn,yn)Note that the line function really doesn’t like to be given aclosed path, which is why we must use this new command.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
To draw circles, we use the command\pscircle*[par](x0,y0){radius}.The pamameters are the ones we have seen before, (x0,y0) isthe center, and radius refers to ... never mind.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
\pspolygon[linewidth=1.5pt](0,2)(1,2) (Note thatif you only use two (nontrivial) points, pspolygon will add theorigin).
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
\pspolygon*[linearc=.2,linecolor=green](3,0)(3,2)(6,0)(6,2)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
\pspolygon*[linearc=.3,linecolor=red](.6,1)(1,2)(2,1.5)(3,2)(3.4,1)(2,0)
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
FormulasExamples
\pscircle*[par](x0,y0){radius}
With these objects, it is easy to control their exact placementvia the coordinates.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
Curves
b
b
b
b
b b b b
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
Bezier Curves“\psbezier draws a bezier curve with the four control points.The curve starts at the first coordinate, tangent to the lineconnecting to the second coordinate. It ends at the lastcoordinate, tangent to the line connecting to the thirdcoordinate. The second and third coordinates, in addition todetermining the tangency of the curve at the endpoints, alsopull the curve towards themselves.” For example:
b
b
b
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
The general form is\psbezier[par]{arrows}(x0,y0)(x1,y1)(x2,y2)(x3,y3)the parameters and arrow commands are the same as thosewe used for lines.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
Parabolas\parabola*[par]{arrows}(x0,y0)(x1,y1)The first coordinate is a point through which the parabolapasses, and the second is its max or min. For example,\parabola{<->}(4,3)(2,0) forms a unique parabola.
b
b
b
b
b b b b
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
Two More CurvesThe following two functions creates a curve that goes throughthe points you give it.\pscurve*[par]{arrows}(x1,y1)(xn,yn)\psecurve*[par]{arrows}(x1,y1)(xn,yn)]The second one differs in that it does not extend the curve tothe endpoints (it just uses them to estimate the shape of thecurve through the other points). The e in the function name isrelated to this effect.
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
\pscurve[showpoints=true]{<->}(0,1.3)(0.7,1.8)(3.3,0.5)(4,1.6)(0.4,0.4)\psecurve[showpoints=true]{<->}(5,0)(5,1.3)(5.7,1.8)(8.3,0.5)(9,1.6)(5.4,0.4)(5,1)
b
b
b
b
b
b
Evelyn Crofts PSTricks
OutlineLines
PolygonsCurves
Bezier CurvesParabolasTwo More Curves
Many thanks to the PSTricks User’s Guide by Timothy VanZandt.If you would like to know more about PSTricks
RTFM!
http://download.tuxfamily.org/viettug/pstricks_user_guide_en-1.pdf
Evelyn Crofts PSTricks
top related