# Routines for Mobius transformations applied to circular arcs # Requires mobius.mpl and MobiusonCircles.mpl # Conversion factor from degrees to radians raddeg:=Pi/180: ## ASSUME: an arc is a circle together with two endpoints z1 , z2. ## The circle is specified by a hermitian matrix H ## The "inside" of the circle has [bar(z) 1] H [z,1] < 0; the outside is > 0. ## We assume the arc goes counterclockwise from z1 to z2 with respect to ## the inside of the circle. # Apply a linear fractional map (matrix M) to # an Harc [C,z1,z2] ArcMap:=proc(M::Matrix,A::list) local U; U:=M^(-1); RETURN( [ map(expand,LinearAlgebra[HermitianTranspose](U)) . A[1] . U, mobius(M,A[2]), mobius(M,A[3])] ) end: # Plot an Harc PlotHarc:=proc(A) global raddeg; local cen,rad,ang1,ang2; cen:=Hcenter(A[1]); rad:=Hradius(A[1]); if evalf(abs(A[1][1,1])) >= evalf(10^(-10)) then # Finite circle ang1:=argument(A[2]-cen); ang2:=argument(A[3]-cen); # Always choose angle less than Pi if ang2 - ang1 > evalf(Pi) then ang2:=ang2-2*Pi; elif ang1 - ang2 > evalf(Pi) then ang1:=ang1-2*Pi; fi; RETURN( plottools[arc]([Re(cen),Im(cen)],rad, ang1..ang2, args[2..nargs]) ) else # Straight line RETURN( plottools[line]( [Re(A[2]),Im(A[2])], [Re(A[3]),Im(A[3])], args[2..nargs] ) ) fi; end: