[net.graphics] plotting on infinite domain

rhbartels@watmps.UUCP (Richard Bartels) (02/13/86)

Subject:  a transformation required


I want to be able to plot f(x) for x in the range [-infinity..infinity],
likewise f(x) in [-infinity..infinity]  on a square screen.  What I need is a
suitable transformation to map this range onto a finite range which yields a
reasonable scaling.  Something like  x / abs(exp(x)) ?
Any suggestions?

-Richard Bartels (asking for a friend in another net realm)

gwyn@brl-smoke.ARPA (Doug Gwyn ) (02/17/86)

>I want to be able to plot f(x) for x in the range [-infinity..infinity],
>likewise f(x) in [-infinity..infinity]  on a square screen.  What I need is a
>suitable transformation to map this range onto a finite range which yields a
>reasonable scaling.  Something like  x / abs(exp(x)) ?

The obvious function to use is tanh().
Atan() is a reasonable alternative.

thomas@utah-gr.UUCP (02/17/86)

In article <325@watmps.UUCP> rhbartels@watmps.UUCP (Richard Bartels) writes:
>I want to be able to plot f(x) for x in the range [-infinity..infinity],
>likewise f(x) in [-infinity..infinity]  on a square screen.

You might think about a "stereographic" projection that maps the plane
onto a hemisphere (which you can then project straight down onto the
unit circle).  Here is a picture:

			     +      .      +
			     +       \     + unit hemisphere
			      +       \   +
				+      \+
plane:	---------------------------------------------------------------
	. is the center of the hemisphere,
	\ indicates a ray from there to the plane

The mapping of a point on the plane to the hemisphere is to project it
along a ray from the center of the hemisphere.  Algebraically, the point
(x,y) goes to the point (x/d, y/d, 1 - 1/d), where d is sqrt(1 + x^2 +y^2).
You can then discard the z coordinate (or not even compute it) to get a
mapping of the plane onto the circle.

If it is important to maintain the rectangular nature of the coordinate
plane (as it might be in plotting (x, f(x)), you could also apply the
projection in each coordinate independently, so that
	(x, f(x)) -> ( x / sqrt(1 + x^2), f(x) / sqrt(1 + f(x)^2) )

-- 
=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA)