# Interact script based on http://interact.sagemath.org/node/20
#
# Shows the action of a Moebius transformation
#
# / a b \ a*z + b
# | | * z := ---------, ad - bc != 0
# \ c d / c*z + d
#
#
# on the complex plane
def mob(A,z):
return (A[0][0]*z + A[0][1]) / (A[1][0]*z + A[1][1])
html('
The Action of a Moebius Transformation
')
@interact(layout = [['a','b','c', 'd','r','auto_update']])
def mob_plot(
a = input_box( 0 + 1*I, label='$a=$', width = 10),
b = input_box( 0 + 1*I, label='$b=$', width = 10),
c = input_box(-1 + 0*I, label='$c=$', width = 10),
d = input_box( 1 + 0*I, label='$d=$', width = 10),
r = input_box( 4, label='window size', width = 5),
auto_update=False):
A = matrix(CC,2,2,[[a,b],[c,d]])
id = complex_plot(lambda z:z,(-r,r),(-r,r) )
output = complex_plot( lambda z: mob(A,z), (-r,r),(-r,r))
html.table([['The action of $A$:', '$z \mapsto \\frac{%s\cdot z + %s}{%s\cdot z + %s}' % (A[0][0],A[0][1],A[1][0],A[1][1]) ], ['Domain = $\mathbb{C}$','Action = $A(\mathbb{C})$'],[id, output]])