AtomTetrahedralLigandPlacer3D { public Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2) { Point3d point1 = atom1.getPoint3d(); Double d1 = atom1.getCovalentRadius(); Double d2 = atom2.getCovalentRadius(); double distance = (d1 == null || d2 == null) ? 1.0 : d1 + d2; if (pSet != null) { distance = getDistanceValue(atom1.getAtomTypeName(), atom2.getAtomTypeName()); } Vector3d vect = new Vector3d(point2); vect.sub(point1); vect.normalize(); vect.scale(distance); Point3d newPoint = new Point3d(point1); newPoint.add(vect); return newPoint; } AtomTetrahedralLigandPlacer3D(); void setParameterSet(Map moleculeParameter); void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer); Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2); Point3d[] get3DCoordinatesForLigands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
            IAtom atomC, int nwanted, double length, double angle); Point3d get3DCoordinatesForSPLigands(IAtom refAtom, IAtomContainer withCoords, double length, double angle); Point3d[] get3DCoordinatesForSP2Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
            IAtom atomC, double length, double angle); Point3d[] get3DCoordinatesForSP3Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
            IAtom atomC, int nwanted, double length, double angle); Point3d[] calculate3DCoordinates0(Point3d aPoint, int nwanted, double length); Point3d[] calculate3DCoordinates1(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
            double length, double angle); Point3d[] calculate3DCoordinates2(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
            double length, double angle); Point3d calculate3DCoordinates3(Point3d aPoint, Point3d bPoint, Point3d cPoint, Point3d dPoint, double length); Point3d calculate3DCoordinatesSP2_1(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
            double angle); Point3d[] calculate3DCoordinatesSP2_2(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
            double angle); static Vector3d rotate(Vector3d vector, Vector3d axis, double angle); double getAngleValue(String id1, String id2, String id3); int makeStereocenter(Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints); double getSpatproduct(Vector3d a, Vector3d b, Vector3d c); double getTorsionAngle(Point3d a, Point3d b, Point3d c, Point3d d); IAtomContainer getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac); IAtomContainer getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac); boolean hasUnsetNeighbour(IAtom atom, IAtomContainer ac); IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac); final static double DEFAULT_BOND_LENGTH_H; final static double TETRAHEDRAL_ANGLE; }
@Test public void rescaleBondLength_IAtom_IAtom_Point3d() { IAtom atom1 = new Atom("C"); atom1.setPoint3d(new Point3d(1, 1, 1)); atom1.setCovalentRadius(0.2); IAtom atom2 = new Atom("C"); atom2.setPoint3d(new Point3d(2, 2, 2)); atom2.setCovalentRadius(0.2); Point3d newpoint = new AtomTetrahedralLigandPlacer3D().rescaleBondLength(atom1, atom2, atom2.getPoint3d()); Assert.assertEquals(0.4, newpoint.distance(atom1.getPoint3d()), 0.001); }