def reflection_from_matrix(matrix):
 M = numpy.array(matrix, dtype=numpy.float64, copy=False)
 (w, V) = numpy.linalg.eig(M[:3, :3])
 i = numpy.where((abs((numpy.real(w) + 1.0)) < 1e-08))[0]
 if (not len(i)):
  raise ValueError('no unit eigenvector corresponding to eigenvalue -1')
 normal = numpy.real(V[:, i[0]]).squeeze()
 (w, V) = numpy.linalg.eig(M)
 i = numpy.where((abs((numpy.real(w) - 1.0)) < 1e-08))[0]
 if (not len(i)):
  raise ValueError('no unit eigenvector corresponding to eigenvalue 1')
 point = numpy.real(V[:, i[(-1)]]).squeeze()
 point /= point[3]
 return (point, normal)

def reflection_from_matrix ( matrix ) : M = numpy . array ( matrix , dtype = numpy . float64 , copy = False ) ( w , V ) = numpy . linalg . eig ( M [ : 3 , : 3 ] ) i = numpy . where ( ( abs ( ( numpy . real ( w ) + 1.0 ) ) < 1e-08 ) ) [ 0 ] if ( not len ( i ) ) : raise ValueError ( 'no unit eigenvector corresponding to eigenvalue -1' ) normal = numpy . real ( V [ : , i [ 0 ] ] ) . squeeze ( ) ( w , V ) = numpy . linalg . eig ( M ) i = numpy . where ( ( abs ( ( numpy . real ( w ) - 1.0 ) ) < 1e-08 ) ) [ 0 ] if ( not len ( i ) ) : raise ValueError ( 'no unit eigenvector corresponding to eigenvalue 1' ) point = numpy . real ( V [ : , i [ ( - 1 ) ] ] ) . squeeze ( ) point /= point [ 3 ] return ( point , normal )
return mirror plane point and normal vector from reflection matrix .