Infinite Graphing

I've been thinking of a method to graph a function over the entire coordinate plane and then mapping it to the surface of a sphere. For mapping all real numbers to a single interval, I realized the inverse tangent function would work. On a side note, does this mean that there are as many real numbers from -π to π as there are from -∞ to ∞?

Then, taking this mapping from infinite to finite intervals, another transformation is needed to map the image onto a sphere. In reality, there is no point to proceed with this mapping since a [-π,π] x [-π,π] square is more informative and can be better represented in 2D media, but it is cool to see something like the inverse function mapped onto a sphere (as represented to the right) since the discontinuities seem to loop around to infinity and back. Although, this may not be the best way to think of functions like this.

The way I chose to do this mapping involved looking at the great circle between the zero and infinite points, which are on opposite ends of a diameter. Then, to plot a single point on the sphere, the transformed x-coordinate is the angle around the great circle with respect to the zero point to construct another circle with this as one point on the circumference, the infinity point being the another point on the circumference, and the center being contained within and perpendicular to the plane of the great circle. Since the slice of a sphere is a circle, this constructed circle is contained on the surface of the sphere. The transformed y-coordinate is now the angle around this constructed circle with respect to the point on the great circle. The point at this angle is the image of the complete transformation from the cartesian plane.

So, mathematically, let f(\vec{x}) be a function \mathbb{R}^2\rightarrow\mathbb{R}^2 that maps all real numbers to the region [-π,π] x [-π,π].

f(\vec{x}) =
\begin{bmatrix}
2\tan^{-1}{x_1} \\
2\tan^{-1}{x_2}
\end{bmatrix}

Then, let g(\vec{x}) be a function \mathbb{R}^2\rightarrow\mathbb{R}^3 that maps the region [-π,π] x [-π,π] to the surface of a sphere centered at the origin with a radius of one. After a bit of math,

g(\vec{x}) = \frac{1}{2}
\begin{bmatrix}
(\cos{x_1}+1)\cdot\cos{x_2}+\cos{x_1}-1 \\
\sin{x_1}\cos{x_2}+\sin{x_1} \\
\sin{x_2}\cdot\sqrt{2\cos{x_1}+2}
\end{bmatrix}

So, the mapping of the complete coordinate plain onto a sphere is a function \mathbb{R}^2\rightarrow\mathbb{R}^3,

h(\vec{x})=g(f(\vec{x}))

For the purposes of displaying a graphic of these plots, a simple linear transformation can be used from \mathbb{R}^3\rightarrow\mathbb{R}^2 that projects vectors onto a plane while scaling to get a more pleasing image. It results in the z-axis pointing up, the x-axis to the left, and the y-axis to the right, maintaining the right hand rule.

\boldmath{T}\vec{x}=
\begin{bmatrix}
-\frac{2}{5} & 1 & 0 \\
-\frac{1}{2} & -\frac{1}{6} & 1
\end{bmatrix}
\vec{x}

This transformation is then applied to h(\vec{x}) to yield something similar to one of the plots on this page.

To the left is a graph of the function f(x)=\frac{1}{5}\sin(\frac{1}{5}x)

This transformation currently distorts functions quite a bit near infinity since it is asymmetric with respect to the images of the x- and y- axis. A good example of the problems inherent in the transformation can be seen in an examination of the function f(x)=x which one would expect to be a great circle with an equal angle between the two axis. But, it gets a strange little curve near infinity, as the graph to the right illustrates. I have an idea for how to make a better transformation involving the intersection of two great circles that are perpendicular to the axis on the surface of the sphere.