[pstricks] Logarithmic range in PST-3d
Felix Hoffmann
fhoffmann at iam.uni-bonn.de
Sun Nov 13 10:30:52 CET 2011
Am 12.11.2011 11:08, schrieb Herbert Voss:
> 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
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/
Thanks Herbert!
The strategy of "\pstVerb{ /Ln { dup abs 1.e-30 lt { pop 1e-30 } if ln }
def } " did not work with me, I got an error anyway, but adding the
minimal value 1.e-32 to the argument of the logarithm fixed the error
message and I got a picture! But I am not perfectly happy as my function
gets some kind of cut off at the value 32 (due to the fact that
-1.0*ln(e^(-32))=32). I very much would like to draw my function
further. Is there any way to make the "ln" function to accept values
that are closer to zero? Some kind of extending some buffer or
redefining the approximation of the "ln" function in the pstricks code
or something like that?
Greetings,
Felix from Bonn
More information about the PSTricks
mailing list