21import static denoptim.utils.MoleculeUtils.getPoint3d;
22import static org.junit.jupiter.api.Assertions.assertFalse;
23import static org.junit.jupiter.api.Assertions.assertTrue;
25import javax.vecmath.Point2d;
26import javax.vecmath.Point3d;
28import org.junit.jupiter.api.Test;
29import org.openscience.cdk.Atom;
30import org.openscience.cdk.interfaces.IAtom;
31import org.openscience.cdk.interfaces.IAtomContainer;
32import org.openscience.cdk.interfaces.IChemObjectBuilder;
33import org.openscience.cdk.silent.SilentChemObjectBuilder;
43 private IChemObjectBuilder
builder = SilentChemObjectBuilder.getInstance();
55 a.setPoint2d(
new Point2d(2.6, -4.2));
60 a.setPoint3d(
new Point3d(2.6, -4.2, 6.4));
72 double delta = 0.0000001;
73 return Math.abs(a-b) <= delta;
81 IAtomContainer mol =
builder.newAtomContainer();
82 mol.addAtom(
new Atom(
"H",
new Point3d(1.2,-2.9,2.5)));
83 mol.addAtom(
new Atom(
"H",
new Point3d(2.3,-4.8,4.2)));
84 mol.addAtom(
new Atom(
"H",
new Point3d(4.5,2.6,-5.4)));
Utilities for molecule conversion.
static Point3d calculateCentroid(IAtomContainer mol)
Calculated the centroid of the given molecule.
Unit test for DENOPTIMMoleculeUtils.
IChemObjectBuilder builder
boolean areCloseEnough(double a, double b)
void testCalculateCentroid()