/** * Create a rotation axis from a vector, a point, and an angle. * * The result will be a pure rotation, with no screw component. * @param axis A vector parallel to the axis of rotation * @param pos A point on the axis of rotation * @param theta The angle to rotate (radians) */ public RotationAxis(Atom axis, Atom pos, double theta) { this.rotationAxis = Calc.unitVector(axis); this.rotationPos = (Atom) pos.clone(); this.theta = theta; this.screwTranslation = new AtomImpl(); //zero this.otherTranslation = null; //deprecated }
/** * Use unit vectors NC and NCalpha Add them. Calc unit vector and * substract it from N. * C coordinates are from amino acid i-1 * N, CA atoms from amino acid i * * @link http://openbioinformatics.blogspot.com/ * 2009/08/how-to-calculate-h-atoms-for-nitrogens.html */ @SuppressWarnings("unused") private static Atom calc_H(Atom C, Atom N, Atom CA) throws StructureException { Atom nc = Calc.subtract(N,C); Atom nca = Calc.subtract(N,CA); Atom u_nc = Calc.unitVector(nc) ; Atom u_nca = Calc.unitVector(nca); Atom added = Calc.add(u_nc,u_nca); Atom U = Calc.unitVector(added); // according to Creighton distance N-H is 1.03 +/- 0.02A Atom H = Calc.add(N,U); H.setName("H"); // this atom does not have a pdbserial number ... return H; }