TITLE: How to smootly interpolate between möbius transformations?
QUESTION [14 upvotes]: If you have two Möbius transformations represented as:
$f(z) = \frac{az + b}{cz + d}$
$g(z) = \frac{pz + q}{rz + s}$
where $a, b, c, d, p, q, r, s, z \in \mathbb{C}$
Is it possible to derive a third function $h(z, t)$, where $t \in \mathbb{R}$ and $0 \leq t \leq 1$, which "smoothly" interpolates between the transformations represented by $f(z)$ and $g(z)$?
Let me try to clarify the meaning of "smoothly".  I'm working in a the Poincaré Disc model of Hyperbolic geometry.  The functions $f$ & $g$ represent transformations which preserve congruence within the model, i.e. a Poincaré line segment $PQ$ will have the same Poincaré distance as $P'Q'$, where $P' = f(P)$ & $Q' = f(Q)$. I would like the interpolated transform to preserve this property as well.
Clarification:
The answers involving diagonalization of the matrix "almost" work.  Let me be clearer about how these mobius transformations are used, so that I can give some more context.
$f$ represents the position and orientation of a tile on the Poincare disc.  I use this to transform a tile centered at the origin. $g$ represents a neighboring tile.  I'd like to "animate" the $f$ tile moving it smoothly on top of the $g$ tile.  While animating, the center of $f$ should travel along the poincare line connecting the two tiles at rest position.
The problem with the diagonalization approach is that the centers of the two tiles will travel about a corner of one of the tiles, sometimes the "long" way around.
Of course it could just be a bug in my code...
P.S. This is for an iphone game I'm developing called Circull
http://www.youtube.com/watch?v=DiWijYb-xus

REPLY [11 votes]: I'd like to address two issues about how to implement these interpolations and what they mean.  The group that you ask about is actually equivalent to the group of real M\"obius transformations.  If you were in the upper half plane model, the coefficients would be real numbers.  You actually don't need to explicitly use the upper half plane model, but you do need the fact that comes from it that all of the motions are elliptic, hyperbolic, or parabolic.  The group is called $\mathrm{PSL}(2,\mathbb{R})$.
It is widely understood that a good way to make smooth motions in a Lie group is with geodesics.  This is an important principle in ordinary 3D computer graphics, where the Lie group is instead $\mathrm{SO}(3)$.  A standard method to find the geodesics in this comparison case is with quaternions.  As it happens, this introduces a wrinkle with doubled angles that also appears in your case.
I assume that you are using $f$ and $g$ as follows:  $z$ is a point in the standard bit map of your bird, and then $f(z)$ or $g(z)$ is the mapped position of the bird in your Poincare disk model of the hyperbolic plane.  If this is what you are doing, then a correct derivation of the geodesic is $h_t(f(z))$, where $h_t(z)$ is an exponential path from the identity to $g(f^{-1}(z))$.  I suppose that the swapped formula that other people have used, $f^{-1} \circ g$, is equivalent.
You can find the exponential path by diagonalizing the matrix of $h_1 = g \circ f^{-1}$.  However, there is the important wrinkle that the group of matrices is $\mathrm{SL}(2,\mathbb{R})$, which is twice as big as $\mathrm{PSL}(2,\mathbb{R})$.  Let $M$ be the matrix of $h_1$.  If $M$ is hyperbolic, then it has real eigenvalues.  In this case, you should first switch to $-M$ if the eigenvalues are negative.  In the basis in which $M$ is diagonal, you should then specifically use
$$M_t = \begin{bmatrix} \exp(ct) & 0 \\\\ 0 & \exp(-ct)\end{bmatrix}.$$
If you use some other choice, you will not follow the geodesic at a constant rate.  If $M$ is elliptic, then you should use
$$M_t = \begin{bmatrix} \exp(i\theta t) & 0 \\\\ 0 & \exp(-i\theta t)\end{bmatrix},$$
again in a (complex) basis in which $M$ is diagonal.  But here, how do you choose between $M$ and $-M$?  The total geometric rotation is $2\theta$, not $\theta$.  You should negate $M$ if after you diagonalized, $\theta$ is more than $\pi/2$; if you don't do that you might rotate by more than 180 degrees.  In the parabolic case (which you might not see because it requires a numerical coincidence),
$$M_t = \begin{bmatrix} 1 & t \\\\ 0 & 1\end{bmatrix}.$$
Finally, in computer graphics you might want a smooth trajectory accelerate from 0 at the beginning and decelerate to 0 at the end.  With the confidence that $t$ in the above formulas follows the geodesic at a uniform rate, you can do something like $t = \sin(s)^2$ and use $s$ as the time parameter instead.