def point_in_plane(self, tri_no, pt):
tri_no = np.asarray(tri_no)<EOL>pt = np.asarray(pt)<EOL>if tri_no.shape is () and len(pt.shape) == <NUM_LIT:1>:<EOL><INDENT>tx = self.coordinates[:, self.tess.faces[:, tri_no]]<EOL>n = self.face_normals[:, tri_no]<EOL>d = np.dot(n, pt - tx[<NUM_LIT:0>])<EOL>return (np.abs(d), pt - n*d)<EOL><DEDENT>if len(pt.shape) == <NUM_LIT:1>:<EOL><INDENT>pt = npml.repmat(pt, len(tri_no), <NUM_LIT:1>).T<EOL><DEDENT>else:<EOL><INDENT>pt = pt.T if pt.shape[<NUM_LIT:0>] != self.coordinates.shape[<NUM_LIT:0>] else pt<EOL>tri_no = np.full(pt.shape[<NUM_LIT:1>], tri_no, dtype=np.int)<EOL><DEDENT>tx0 = self.coordinates[:,  self.tess.faces[<NUM_LIT:0>,tri_no]]<EOL>n   = self.face_normals[:, tri_no]<EOL>d   = np.sum(n * (pt - tx0), axis=<NUM_LIT:0>)<EOL>return (np.abs(d), pt - n*d)<EOL>
r.point_in_plane(id, pt) yields the distance from the plane of the id'th triangle in the
registration r to the given pt and the point in that plane as a tuple (d, x).
If id or pt or both are lists, then the elements d and x of the returned tuple are a vector
and matrix, respectively, where the size of x is (dims x n).