예제 #1
0
파일: Atom.py 프로젝트: bingao/bnlego
 def rotate(self,R):
     """Performs rotation operation by the rotation matrix R."""
     from BioNanoLEGO.DenseMatrix import dot
     # FIXME: this assignment is ugly in my opinion
     new_coords = dot(R,self.coords)
     self.coords = array([new_coords[0,0],new_coords[0,1],new_coords[0,2]])
     return
예제 #2
0
파일: Atom.py 프로젝트: bingao/bnlego
 def getDistance(self,other):
     """Calculates the distance between two atoms."""
     from math import sqrt
     from BioNanoLEGO.DenseMatrix import dot
     # Displacement between two atoms
     disp_atoms = self.coords-other.coords
     return sqrt(dot(disp_atoms,disp_atoms))
예제 #3
0
파일: Atom.py 프로젝트: bingao/bnlego
 def getSquareDist(self,other):
     """Calculates the square distance between two atoms."""
     from BioNanoLEGO.DenseMatrix import dot
     # Displacement between two atoms
     disp_atoms = self.coords-other.coords
     return dot(disp_atoms,disp_atoms)