Fixed normal_vectors() and removed old pbc_diff
This commit is contained in:
parent
a4c365c4a1
commit
57a492cb48
@ -565,7 +565,6 @@ def normal_vectors(
|
|||||||
vec = np.cross(vectors_a, vectors_b)
|
vec = np.cross(vectors_a, vectors_b)
|
||||||
if normed:
|
if normed:
|
||||||
vec /= np.linalg.norm(vec, axis=-1).reshape(-1, 1)
|
vec /= np.linalg.norm(vec, axis=-1).reshape(-1, 1)
|
||||||
vec.reference = coords_a
|
|
||||||
return vec
|
return vec
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,20 +8,6 @@ from itertools import product
|
|||||||
from .logging import logger
|
from .logging import logger
|
||||||
|
|
||||||
|
|
||||||
def pbc_diff_old(v1, v2, box):
|
|
||||||
"""
|
|
||||||
Calculate the difference of two vestors, considering optional boundary conditions.
|
|
||||||
"""
|
|
||||||
if box is None:
|
|
||||||
v = v1 - v2
|
|
||||||
else:
|
|
||||||
v = v1 % box - v2 % box
|
|
||||||
v -= (v > box / 2) * box
|
|
||||||
v += (v < -box / 2) * box
|
|
||||||
|
|
||||||
return v
|
|
||||||
|
|
||||||
|
|
||||||
def pbc_diff(v1, v2=None, box=None):
|
def pbc_diff(v1, v2=None, box=None):
|
||||||
if box is None:
|
if box is None:
|
||||||
out = v1 - v2
|
out = v1 - v2
|
||||||
|
Loading…
Reference in New Issue
Block a user