# Real and imaginary parts of the Möbius transformation

Given that the Möbius transformation is:

$f(z) = \frac{az+b}{cz+d}$

$ad-bc \neq 0$ and with $a,b,c$ and $d$ complex numbers written $a= a_1 + a_2i$ etc.

I think I must be missing something because when separating the Möbius transformation in to its real and imaginary parts I got this:

$\frac{(a_1c_1+a_2c_2)z^2 + (b_1c_1+b_2c_2)z +(a_1d_1+a_2d_2)z +(b_1d_1+b_2d_2)}{|c|^2z^2 + |d|^2}$ for the real part... and

$\frac{(a_1c_1-a_2c_2)z^2 + (b_1c_1-b_2c_2)z +(a_1d_1-a_2d_2)z +(b_1d_1-b_2d_2)}{|c|^2z^2 + |d|^2}i$ as the imaginary.

It really looks awful, is there a better way to write this?

Update. Duh. Dumb mistake, reworking them I get this, the point is it's still ugly.

Real: $\frac{(a_1x-a_2y+b_1)(c_1x-c_2y+d_1) -(a_2x+a_1y+b_2)(c_2x+c_1y+d_2)}{(c_1x-c_2y+d_1)^2 - (c_2x+c_1y+d_2)^2}$

$\frac{R(ac)x^2 - 2(a_1c_2 + a_2c_1)xy + (R(ad) + R(bc))x - (R(ab) + R(bc))y - R(ac)y^2 + R(bd)}{(c_1x-c_2y+d_1)^2 - (c_2x+c_1y+d_2)^2}$

Img: $\frac{(a_2x-a_1y+b_2)(c_1x-c_2y+d_1) -(a_1x+a_2y+b_1)(c_2x+c_1y+d_2)}{(c_1x-c_2y+d_1)^2 - (c_2x+c_1y+d_2)^2}$

-
Do you genuinely need to have the real and imaginary parts all be in terms of real variables (i.e. real and imaginary parts of input quantities)? If so, then yes, the expressions are positively baroque. –  Ｊ. Ｍ. May 3 '11 at 4:35

Hmm, after trying on my own, what I'm getting is (where $z=x+iy$, as usual):

$$\Re\left(\frac{az+b}{cz+d}\right)=\frac{\mu\,\Re(a)+\nu\,\Im(a)+\xi\,\Re(b)+\eta\,\Im(b)}{\Delta}$$

$$\Im\left(\frac{az+b}{cz+d}\right)=\frac{\mu\,\Im(a)-\nu\,\Re(a)+\xi\,\Im(b)-\eta\,\Re(b)}{\Delta}$$

where

$\mu=|z|^2\Re(c)+\alpha$

$\nu=|z|^2\Im(c)+\beta$

$\xi=x\Re(c)-y\Im(c)+\Re(d)$

$\eta=x\Im(c)+y\Re(c)+\Im(d)$

$\Delta=|z|^2 |c|^2+|d|^2+2\alpha\,\Re(c)+2\beta\,\Im(c)$

and

$\alpha=x\Re(d)+y\Im(d)$

$\beta=x\Im(d)-y\Re(d)$

The usual admonition in programming to "isolate common subexpressions" is a useful way to deal with complexity.

-
This is not the correct splitting: mind that $z$ is complex too, so you have to write $z=x+iy$, if you want to represent $f(z)=u(x,y)+iv(x,y)$. It will get a lot worse...
just as $Re(\overline{ac})$ :) –  Dennis Gulko May 2 '11 at 23:43