[math-fun] employing asinh for false perspective
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: http://www.tiac.net/~sw/2007/02/asinh_perspective 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. There is Postscript source code there for both pictures. --Steve
From: Henry Baker <hbaker1@pipeline.com> Date: Sun, 06 Aug 2006 21:39:29 -0700
BTW, "asinh" now has a real paying job. I searched using Google and I found that astronomers are now using asinh instead of log to compute brightness of stars in a star catalog.
I have advocated the use of asinh in audio & video processing to do "dynamic range compression" in a way which is somewhat smoother than current ad hoc methods and floating point methods.
Another job is its use in genetic engineering & statistics to smooth data better than log when very small magnitudes are encountered, which would otherwise drive log nuts (i.e., very substantially negative).
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
On 2/20/07, David W. Cantrell <DWCantrell@sigmaxi.net> wrote:
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.
I clicked on the picture and it got bigger.
On 2007 Feb. 20, "James Buddenhagen" <jbuddenh@gmail.com> wrote:
On 2/20/07, David W. Cantrell <DWCantrell@sigmaxi.net> wrote:
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.
I clicked on the picture and it got bigger.
That would be great if, for me, there _were_ a picture to click on! Am I the only one who doesn't see something to click on? David
David wrote:
That would be great if, for me, there _were_ a picture to click on! Am I the only one who doesn't see something to click on?
There's a missing closing angle bracket on <a href="logmap3.gif" so depending on what browser you're using, it may attempt to fix that or not; it's not your fault, but using another browser will let you see it until the author fixes his page. -- Mike Stay metaweta@gmail.com http://math.ucr.edu/~mike
participants (4)
-
David W. Cantrell -
James Buddenhagen -
Mike Stay -
Steve Witham