File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/geometry/surface Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 2020
2121package org .openscience .cdk .geometry .surface ;
2222
23+ import org .openscience .cdk .geometry .GeometryUtil ;
24+ import org .openscience .cdk .graph .rebond .Point ;
2325import org .openscience .cdk .interfaces .IAtom ;
2426
27+ import javax .vecmath .Point3d ;
2528import java .util .ArrayList ;
2629import java .util .HashMap ;
2730import java .util .List ;
@@ -120,12 +123,11 @@ public int[] getNeighbors(int i) {
120123 if (nbrs != null ) {
121124 for (Integer nbr : nbrs ) {
122125 if (nbr != i ) {
123- IAtom aj = atoms [nbr ];
124- double x12 = aj .getPoint3d ().x - atom .getPoint3d ().x ;
125- double y12 = aj .getPoint3d ().y - atom .getPoint3d ().y ;
126- double z12 = aj .getPoint3d ().z - atom .getPoint3d ().z ;
127- double d2 = x12 * x12 + y12 * y12 + z12 * z12 ;
128- if (d2 < maxDist2 ) result .add (nbr );
126+ IAtom anbr = atoms [nbr ];
127+ Point3d p1 = anbr .getPoint3d ();
128+ Point3d p2 = atom .getPoint3d ();
129+ if (p1 .distanceSquared (p2 ) < maxDist2 )
130+ result .add (nbr );
129131 }
130132 }
131133 }
You can’t perform that action at this time.
0 commit comments