def compose(self,rhs): lhs = self nDims = len(self.t) t = rhs.apply(self.t) # = rhs(lhs(0)) if True: R = Mat.identity(nDims) for i in xrange(nDims): R[i] = translate(rhs.apply(lhs.apply(R[i])), -t) # R[i] = Isometry(I,t)^-1(rhs(lhs(I[i]))) R = Mat(R) else: # Argh, I thought this was right, but it's not?? wtf? R = self.R * rhs.R return HyperbolicIsometry(R,t)
def __init__(self,R=None,t=None): # R and t can't both be None, or we wouldn't know the dimension if R == None: R = Mat.identity(len(t)) if t == None: t = [0]*len(R) self.R = Mat(R) self.t = Vec(t)
def identity(nDims): return HyperbolicIsometry(Mat.identity(nDims), [0]*nDims)