On 2007 Feb. 20, "Steve Witham" <sw@tiac.net> wrote:
I was plotting a fractal and wanted a false-perspective view, where the magnification is really high at one point, and decreases in a log-like way further out from there. Like that cartoon map of the U.S. from the point of view of Manhattan. The mapping needs to be like a log until you get close to zero, then flatten out.
I don't know whether it was Henry Baker's comment from last August that triggered it, but I thought of the asinh function. Here is the nice result:
You say "Here's an example, click for the full size: " but I saw nothing to click on.
In the process of programming this, I needed an asinh for Postscript. The one I found is in a package called "pst-math.pro". (.pro is apparently a suffix for Postscript libraries.) The definition basically means asinh( x ) = ln( x + sqrt( x^2 + 1 ) )
which is the standard definition, but there is a precision-slash- overflow problem when x < 0 if you actually calculate it that way in floating point. The link above has a trippy graph of the problem.
If that only presents a problem for x < 0, then perhaps use the fact that asinh is an odd function, thereby calculating it using sgn(x) ln( |x| + sqrt(x^2 + 1) ) David