# Talk:PSTricks

## Some basic instructions on how to get started with pstricks

This page could do with some novice instructions on how to get pstricks going.

Something like : 1. get the pstricks.sty file from somewhere, 2. put \usepackage{pstricks} ...

I'm not 100% on how to do that though (hence I'm making this comment :-) —Preceding unsigned comment added by Drevicko (talkcontribs) 00:02, 22 October 2008 (UTC)

## Hyperbolic paraboloid plot

Hi,

love the hyperbolic paraboloid plot you uploaded. As I'm in the process of getting to grips with PSTricks myself, I would love to see the source. (How about posting it on the picture's discussion page?)

Thanks in advance! – RetZ 04:51, 21 January 2006 (UTC)

I couldn't find that one, but got a few similars: Notice these were done using the extrapackage pst-3dplot (not sure if it's stable as of now, it was beta back then) and using parametric coordinates

Ellipsoid

\documentclass[12pt]{article}
\usepackage{pstricks}
\usepackage{pst-3dplot}
\usepackage{amsmath}
\pagestyle{empty}
\begin{document}
\framebox{
\begin{pspicture}(-5.5,-3)(6, 4)
\newrgbcolor{light}{0.3 0.4 0.6}
\psset{linewidth=0.5pt}
\psset{linewidth=0.1pt,linecolor=light,plotstyle=line,Beta=15,Alpha=60}
\pstThreeDCoor[xMin=-5,xMax=5,yMin=-5,yMax=5,zMin=-2,zMax=3]
\parametricplotThreeD[yPlotpoints=120](0,180)(0,360){%
4 u cos mul t sin mul 6 t sin mul u sin mul 2 t cos mul}
\parametricplotThreeD[xPlotpoints=90](0,360)(0,180){%
4 t cos mul u sin mul 6 t sin mul u sin mul 2 u cos mul}
\end{pspicture}
}
\end{document}

Cillindric Hyperboloid
\documentclass[12pt]{article}
\usepackage{pstricks}
\usepackage{pst-3dplot}
\usepackage{pst-math}
\usepackage{amsmath}
\pagestyle{empty}
\begin{document}
\framebox{
\begin{pspicture}(-5.8,-5)(6, 5)
\newrgbcolor{light}{0.3 0.4 0.6}
\psset{linewidth=0.1pt,linecolor=light,plotstyle=line,Beta=20,Alpha=30}\parametricplotThreeD[yPlotpoints=60](3,5)(-3,3){%
t
t t mul 9 div 1 sub sqrt 2 mul
u}
\parametricplotThreeD[yPlotpoints=60](3,5)(-3,3){%
t
t t mul 9 div 1 sub sqrt -2 mul
u}
\parametricplotThreeD[yPlotpoints=60](3,5)(-3,3){%
-1 t mul
t t mul 9 div 1 sub sqrt 2 mul
u}
\parametricplotThreeD[yPlotpoints=60](3,5)(-3,3){%
-1 t mul
t t mul 9 div 1 sub sqrt -2 mul
u}
\parametricplotThreeD[yPlotpoints=40](-3,3)(3,5){%
u
u u mul 9 div 1 sub sqrt 2 mul
t}
\parametricplotThreeD[yPlotpoints=40](-3,3)(3,5){%
-1 u mul
u u  mul 9 div 1 sub sqrt 2 mul
t}
\parametricplotThreeD[yPlotpoints=40](-3,3)(3,5){%
u
u u  mul 9 div 1 sub sqrt -2 mul
t}
\parametricplotThreeD[yPlotpoints=60](-3,3)(3,5){%
-1 u mul
u u mul 9 div 1 sub sqrt -2 mul
t}
\psset{linewidth=0.5pt}
\pstThreeDCoor[xMin=-5,xMax=5,yMin=-3,yMax=3,zMin=-2,zMax=3.5]
\end{pspicture}
}
\end{document}


Now, a few nice ones

Sinusoidal wave I don't know why pst-func is there maybe is not needed (cos is a builtin postscript function)

\documentclass[12pt]{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{amsmath}
\usepackage{graphicx}
\pagestyle{empty}
\usepackage{color}
\begin{document}
\colorbox{white}{
%\framebox{
\begin{pspicture*}(-7,-3)(7,2)
\psaxes[labels=none](0,0)(-7,-2)(7,2)
\psgrid[subgriddiv=1,griddots=10,gridlabels=7pt](-6,-1.5)(6,1.5)
\psplot[linecolor=blue, linewidth=1pt]{-6.2831}{6.2831}{x 180 mul 3.14159265 div cos}
\end{pspicture*}
}
\end{document}


covering space pic this one is nice, no need of exra packages
\documentclass[12pt]{article}
\usepackage{pstricks}
\pagestyle{empty}
\usepackage{color}
\begin{document}
\colorbox{white}{
\begin{pspicture}(-4,-1)(3,6)
\psellipse[fillstyle=solid,fillcolor=lightgray](0,0)(1.5,0.4)
\psellipse[fillstyle=solid,fillcolor=lightgray](0,3)(1.5,0.4)
\psellipse[fillstyle=solid,fillcolor=lightgray](0,4)(1.5,0.4)
\psellipse[fillstyle=solid,fillcolor=lightgray](0,5.5)(1.5,0.4)
\uput[180](-2,0){$U$}
\psline{->}(0,2.2)(0,0.8)
\uput[180](-2,4){$f^{-1}(U)$}
\uput[90](0,4.5){$\vdots$}
\uput[0](0,1.5){$p$}
\end{pspicture}
}
\end{document}


Homothetic triangles
\documentclass{articlel}
\usepackage{pstricks}
\usepackage{pst-eucl}  %%% This is an experimental unsupported package for geometry stuff
\usepackage{color}
\begin{document}
\pagestyle{empty}
\colorbox{white}{
%\framebox{
\psset{unit=1.3}
\begin{pspicture}(-6.5,0)(5,6.5)
\pstGeonode[PosAngle={180,90,0,180}](1,4){A}(2,2){B}(4,4){C}(1.5,6){D}
\pstGeonode[PosAngle=180](-6,3){O}
\pstLineAB{A}{B}
\pstLineAB{B}{C}
\pstLineAB{C}{D}
\pstLineAB{D}{A}
\psset{HomCoef=0.6}
\pstHomO[PosAngle=0]{O}{A}{A'}
\pstHomO[PosAngle=270]{O}{B}{B'}
\pstHomO[PosAngle=-40]{O}{C}{C'}
\pstHomO[PosAngle=90]{O}{D}{D'}
\pstLineAB{A'}{B'}
\pstLineAB{B'}{C'}
\pstLineAB{C'}{D'}
\pstLineAB{D'}{A'}
\pstLineAB[linestyle=dashed]{A}{O}
\pstLineAB[linestyle=dashed]{B}{O}
\pstLineAB[linestyle=dashed]{C}{O}
\pstLineAB[linestyle=dashed]{D}{O}
\end{pspicture}
}
\end{document}

conjugate unit hyperbolas Notice the use of cropping within a box effect
\documentclass[12pt]{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{amsmath}
\pagestyle{empty}
\usepackage{color}
\begin{document}
\colorbox{white}{
\begin{pspicture*}(-4.4,-4.4)(4.2,4.4)
\psaxes[labels=none,ticks=none](0,0)(-4,-4)(4,4)
\psgrid[subgriddiv=1,griddots=10,gridlabels=7pt](-4,-4)(4,4)
\parametricplot[linecolor=blue,linewidth=1pt]{0}{1.57}{1 t  57.2958 mul cos div t  57.2958 mul dup sin exch cos div}
\parametricplot[linecolor=blue,linewidth=1pt]{0}{1.57}{1 t  57.2958 mul cos div t  -57.2958 mul dup sin exch cos div}
\parametricplot[linecolor=blue,linewidth=1pt]{0}{1.57}{-1 t  57.2958 mul cos div t  57.2958 mul dup sin exch cos div}
\parametricplot[linecolor=blue,linewidth=1pt]{0}{1.57}{-1 t  57.2958 mul cos div t  -57.2958 mul dup sin exch cos div}
\uput[0](1.8,1.2){$x^2-y^2=1$}
\parametricplot[linecolor=green,linewidth=1pt]{0}{1.57}{t  57.2958 mul dup sin exch cos div 1 t  57.2958 mul cos div  }
\parametricplot[linecolor=green,linewidth=1pt]{0}{1.57}{t  -57.2958 mul dup sin exch cos div 1 t  57.2958 mul cos div  }
\parametricplot[linecolor=green,linewidth=1pt]{0}{1.57}{t  57.2958 mul dup sin exch cos div -1 t  57.2958 mul cos div  }
\parametricplot[linecolor=green,linewidth=1pt]{0}{1.57}{t  -57.2958 mul dup sin exch cos div -1 t  57.2958 mul cos div  }
\uput[0](-2,2.5){$y^2-x^2=1$}
\psplot[linecolor=red]{-4}{4}{x}
\psplot[linecolor=red]{-4}{4}{-1 x mul}
\end{pspicture*}
}
\end{document}