%%%%%%%%%%%%%%%%%%%%% Schwartz Triangle Constructor %%%%%%%%%%%%%%%%%%%%% % % SCHWARTZ % Usage: T = SCHWARTZ(p,q,r) % Inputs: p,q,r - real numbers with 1/p +1/q +1/r < 1 % % Output: matrix of numbers [ 0, s, t*exp(pi*I/p)] such that the % angles at the vertices are given by % % vertex hyperbolic angle % % 0 pi/p % s pi/q % t*exp(pi*I/p) pi/r % % function T = schwartz(p,q,r) I = sqrt(-1); a = pi/p; b = pi/q; c = pi/r; d = pi-a-b-c; % this is positive % the relationship of the all these quantities is: % % Hyperbolic Euclidean % vertex hyperbolic angle euclidean angles opposite side % % 0 pi/p a 2*r*sin(d/2) % s pi/q b+d/2 t % t*exp(pi*I/p) pi/r c+d/2 s % % where r is the radius of the circle defining the geodesic % r,s,t satisfy (Law of Sines, Law of Cosines) % % 2*r*sin(d/2)/sin(a) = s/sin(c+d/2) = t/sin(d+d/2) (Law of Sines, above triangle) % 1 = s^2 +2*r*s*sin(b) triangle [ 0, s, centre of circle] % 1 = t^2 +2*r*t*sin(c) triangle [ 0, t*exp(pi*I/p), centre of circle] % the equations above may be solved for r,s,t: w = 2*sin(d/2)/sin(a); u = sin(c+d/2); v = sin(b+d/2); r = 1/sqrt(w^2*u^2 + 2*u*w*sin(b)); s = u*w*r; t = v*w*r ; T = [ 0, s, t*exp(pi*I/p)];