public double getTranslation() { return Calc.amount(screwTranslation); }
/** * Handle cases with small angles of rotation * @param rotation * @param translation */ private void calculateTranslationalAxis(Matrix rotation, Atom translation) { // set axis parallel to translation rotationAxis = Calc.scale(translation, 1./Calc.amount(translation)); // position is undefined rotationPos = null; screwTranslation = translation; otherTranslation = new AtomImpl(); otherTranslation.setCoords(new double[] {0,0,0}); }
/** * Returns the unit vector of vector a . * * @param a * an Atom object * @return an Atom object */ public static final Atom unitVector(Atom a) { double amount = amount(a) ; double[] coords = new double[3]; coords[0] = a.getX() / amount ; coords[1] = a.getY() / amount ; coords[2] = a.getZ() / amount ; a.setCoords(coords); return a; }