# [pstricks] Defining a maxmum and minimum point

Herbert Voss LaTeX at zedat.fu-berlin.de
Sun Apr 8 18:32:10 CEST 2007

Arne Hallam wrote:
> So I am going to answer part of my own question.
>
> I read a bit more carefully in the PST-3dplot manual and found a couple
> of pages I had missed.  So I am part of the way there.
>
> In the code below I seem to be making a mistake in the definition of the
> function so that it points down instead of up.  I cannot see anything
> obvious in my function definition.
>
> z= 2(5x +4y -2x^2 +xy -y^2) -6x - 2y
>
>
there was an error in your math expression. Delete the hiddenLine
option if you do not it.

\documentclass{amsart}
\usepackage{pstricks,pst-3dplot}
\pagestyle{empty}

\begin{document}
$z= 2(5x +4y -2x^2 +xy -y^2) -6x - 2y$

\begin{pspicture*}(-6,-5)(7,10)
\psplotThreeD[hiddenLine,plotstyle=curve,linecolor=red, drawStyle=xLines,
yPlotpoints=20, xPlotpoints=20,linewidth=0.75pt,algebraic](0,4)(0,4){%
x 5 mul
x dup mul 2 mul sub
y dup mul sub
2 mul
x 6 mul sub
y 2 mul sub}
\pstThreeDCircle(+1,+2,0)(.4,.4,0)(.4,-.4,0)
\pstThreeDDot[drawCoor=true,linecolor=blue](+1,+2,9)
\pstThreeDCoor[linecolor=black,zMin=-6,xMax=4,yMax=4,zMax=11,linewidth=1pt]
\end{pspicture*}

\end{document}

Herbert