Skip to content

Commit 59cdfa2

Browse files
committed
update cone projection
1 parent 3f1b479 commit 59cdfa2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/pairable_atoms.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ def in_cone(atom_1_, exit_point_, atom_2_, angle_=(np.pi/4), h_=6):
9898
inside = False
9999
radius = np.tan(angle_) * h_
100100
vect_axis = np.array(exit_point_) - np.array(atom_1_)
101-
axis = vect_axis / np.linalg.norm(vect_axis) * h_ # norm of axis should be h_
101+
#axis = vect_axis / np.linalg.norm(vect_axis) * h_ # norm of axis should be h_, version 1.0.0
102+
# fixed cone projection
103+
# previous cone implementation limted to right isoceles triangle of length h_
104+
axis = vect_axis / np.linalg.norm(vect_axis) # norm of axis should be 1, version 2.0.0
102105
#print(np.linalg.norm(axis))
106+
103107
proj_axis_dist = np.dot((np.array(atom_2_)-np.array(atom_1_)), axis)
104108
#print(proj_axis_dist)
105109
#if h_ >= proj_axis_dist >= 0: # means atom found in the right exit direction and cone heigth limited to 6

0 commit comments

Comments
 (0)