Skip to content

Commit

Permalink
update: add volume
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Dec 7, 2024
1 parent 0a20006 commit 3f7a817
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/py/mat3ra/made/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ def convert_point_to_crystal(self, point: List[float]) -> List[float]:
def scale_by_matrix(self, matrix: List[List[float]]):
np_vector = np.array(self.vectors_as_array)
self.vector1, self.vector2, self.vector3 = np.dot(np.array(matrix), np_vector).tolist()

@property
def volume(self) -> float:
return np.linalg.det(np.array(self.vectors_as_array))

0 comments on commit 3f7a817

Please sign in to comment.