[pstricks] Logarithmic range in PST-3d

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Nov 12 11:08:15 CET 2011


Am 11.11.2011 15:35, schrieb Felix Hoffmann:

> \begin{pspicture}(-6.5,-6.5)(6.5,6.5)\psset{Alpha=30,Beta=15}
> \psplotThreeD[plotstyle=curve, drawStyle=xyLines,hiddenLine=false,
> yPlotpoints=50,xPlotpoints=50,linewidth=0.5pt,algebraic=true,zThreeDunit=0.1](-7,7)(-7,7){-1.0*ln(0.31831*(2.718^(-0.5*4*((x-3)^2+(y-3)^2)))+0.31831*(2.718^(-0.5*4*((x+3)^2+(y+3)^2))))}%{-1.0*ln(0.31831*2.718^(-0.5*(4*(x-3)^2+4*(y-3)^2))+0.31831*2.718^(-0.5*(4*(x
> + 3)^2+4*(y + 3)^2)))}


> I hope, that someone may give me a trick or hack to come by this
> problem. I guess it has something to do with the values, the logarithm
> accepts or some evaluation issues...

you must catch the ln(0) expression, eg:

\pstVerb{ /Ln { dup abs 1.e-30 lt { pop 1e-30 } if ln } def }

\begin{pspicture}(-6.5,-6.5)(6.5,6.5)\psset{Alpha=30,Beta=15}
\psplotThreeD[plotstyle=curve, drawStyle=xyLines,hiddenLine=false, 
yPlotpoints=50,xPlotpoints=50,linewidth=0.5pt,algebraic=true,zThreeDunit=0.1](-7,7)(-7,7)%
   {-1.0*Ln(0.31831*(2.718^(-0.5*(4*(x-3)^2+4*(y-3)^2)))%
            +0.31831*(2.718^(-0.5*(4*(x+3)^2+4*(y+3)^2))))}


or alternetively:

   {-1.0*Ln(1.e-32+0.31831....


Herbert


More information about the PSTricks mailing list