%%%%%%%%%%%%%%%%%%%%% Hyperbolic Midpoint of Hyperbolic Line Segment %%%%%%%%%%%%%%%%%%%%% % % HMIDPOINT % Usage: z = HMIDPOINT(x,y) % Inputs: x,y are points in the euclidean disc % % Output: z the euclidean center of the line connecting the points % if x and y are not distinct or lie on a diameter inf is returned function z = hmidpoint(x,y) if abs(x-y) == 0 z = x, return, end if real(conj(x)*y) == 0 if abs(x) == 0 E(1) = y/abs(y); else E(1) = x/abs(x); end E(2)= - E(1); else E = endpoints(euccentre(x,y)); end L = lft([E(1),x,E(2)],[-1,0,1]); y1 = lftact(L,y); z1 = hyptoeuc(0.5*euctohyp(y1)); z= lftact(inv(L),z1);