Skip to content

Commit

Permalink
Further tweaks, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Aug 26, 2023
1 parent f589ece commit a7112a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/chemiscope/structures/_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def arrow_from_vector(
)
return arrow


def ellipsoid_from_tensor(tensor, scale=1.0, force_positive=False):
"""
Returns an ellipsoid (semiaxes + quaternion) representation of
Expand Down Expand Up @@ -144,9 +145,10 @@ def ellipsoid_from_tensor(tensor, scale=1.0, force_positive=False):

# Form the rotation matrix from eigenvectors
rotation = eigenvectors.T

# converts to quaternion
from scipy.spatial.transform import Rotation

quaternion = Rotation.from_matrix(rotation).as_quat()

return dict(
Expand Down

0 comments on commit a7112a7

Please sign in to comment.