2020 * Created on 08.05.2004
2121 *
2222 */
23-
24-
2523package org .biojava .nbio .structure ;
2624
2725import org .biojava .nbio .structure .jama .Matrix ;
3331import javax .vecmath .Point3d ;
3432import javax .vecmath .Vector3d ;
3533
36-
37-
38- /** utility operations on Atoms, AminoAcids, etc.
34+ /**
35+ * Utility operations on Atoms, AminoAcids, etc.
3936 * <p>
40- * Currently the
41- * coordinates of an Atom are stored as an array of size 3
42- * (double[3]). It would be more powerful to use Point3D from
43- * javax.vecmath. but unfortunately this is not a part of standard
44- * java installations, since it comes with java3d . So to keep things
37+ * Currently the coordinates of an Atom are stored as an array
38+ * of size 3 (double[3]). It would be more powerful to use Point3D from
39+ * javax.vecmath, but unfortunately this is not a part of standard
40+ * java installations, since it comes with java3d. So to keep things
4541 * simple at the moment biojava does not depend on java3d.
46- * </p>
42+ *
4743 * @author Andreas Prlic
4844 * @since 1.4
4945 * @version %I% %G%
@@ -53,7 +49,6 @@ public class Calc {
5349
5450 private final static Logger logger = LoggerFactory .getLogger (Calc .class );
5551
56-
5752 /**
5853 * calculate distance between two atoms.
5954 *
@@ -73,7 +68,7 @@ public static final double getDistance(Atom a, Atom b) {
7368
7469
7570 /**
76- * Will calculate the * square* of distances between two atoms. This will be
71+ * Will calculate the square of distances between two atoms. This will be
7772 * faster as it will not perform the final square root to get the actual
7873 * distance. Use this if doing large numbers of distance comparisons - it is
7974 * marginally faster than getDistance().
@@ -314,10 +309,9 @@ public static final boolean isConnected(AminoAcid a, AminoAcid b) {
314309 return distance < 2.5 ;
315310 }
316311
317-
318-
319- /** rotate a single atom aroud a rotation matrix.
320- * matrix must be a 3x3 matrix.
312+ /**
313+ * Rotate a single Atom aroud a rotation matrix.
314+ * The rotation Matrix must be a pre-multiplication 3x3 Matrix.
321315 *
322316 * If the matrix is indexed m[row][col], then the matrix will be
323317 * pre-multiplied (y=atom*M)
@@ -340,15 +334,18 @@ public static final void rotate(Atom atom, double[][] m){
340334 atom .setZ (nz );
341335 }
342336
343- /** Rotate a structure.
337+ /**
338+ * Rotate a structure.
339+ * The rotation Matrix must be a pre-multiplication Matrix.
344340 *
345341 * @param structure a Structure object
346- * @param rotationmatrix an array (3x3) of double representing the rotation matrix.
342+ * @param rotationmatrix an array (3x3) of double
343+ * representing the rotation matrix.
347344 * @throws StructureException ...
348345 */
349- public static final void rotate (Structure structure , double [][] rotationmatrix )
350- throws StructureException
351- {
346+ public static final void rotate (Structure structure ,
347+ double [][] rotationmatrix ) throws StructureException {
348+
352349 if ( rotationmatrix .length != 3 ) {
353350 throw new StructureException ("matrix does not have size 3x3 !" );
354351 }
@@ -359,13 +356,17 @@ public static final void rotate(Structure structure, double[][] rotationmatrix)
359356 }
360357 }
361358
362- /** rotate a structure .
359+ /**
360+ * Rotate a Group.
361+ * The rotation Matrix must be a pre-multiplication Matrix.
363362 *
364363 * @param group a group object
365- * @param rotationmatrix an array (3x3) of double representing the rotation matrix.
364+ * @param rotationmatrix an array (3x3) of double
365+ * representing the rotation matrix.
366366 * @throws StructureException ...
367367 */
368- public static final void rotate (Group group , double [][] rotationmatrix ) throws StructureException {
368+ public static final void rotate (Group group ,
369+ double [][] rotationmatrix ) throws StructureException {
369370
370371 if ( rotationmatrix .length != 3 ) {
371372 throw new StructureException ("matrix does not have size 3x3 !" );
@@ -380,7 +381,9 @@ public static final void rotate(Group group, double[][] rotationmatrix) throws S
380381 }
381382 }
382383
383- /** Rotate an atom around a Matrix object.
384+ /**
385+ * Rotate an Atom around a Matrix object.
386+ * The rotation Matrix must be a pre-multiplication Matrix.
384387 *
385388 * @param atom atom to be rotated
386389 * @param m rotation matrix to be applied to the atom
@@ -401,7 +404,9 @@ public static final void rotate(Atom atom, Matrix m){
401404
402405 }
403406
404- /** Rotate a group object.
407+ /**
408+ * Rotate a group object.
409+ * The rotation Matrix must be a pre-multiplication Matrix.
405410 *
406411 * @param group a group to be rotated
407412 * @param m a Matrix object representing the rotation matrix
@@ -418,7 +423,9 @@ public static final void rotate(Group group, Matrix m){
418423
419424 }
420425
421- /** Rotate a structure object.
426+ /**
427+ * Rotate a structure object.
428+ * The rotation Matrix must be a pre-multiplication Matrix.
422429 *
423430 * @param structure the structure to be rotated
424431 * @param m rotation matrix to be applied
@@ -437,6 +444,8 @@ public static final void rotate(Structure structure, Matrix m){
437444
438445 /**
439446 * Transform an array of atoms at once.
447+ * The transformation Matrix must be a post-multiplication Matrix.
448+ *
440449 * @param ca array of Atoms to shift
441450 * @param t transformation Matrix4d
442451 */
@@ -446,7 +455,9 @@ public static void transform(Atom[] ca, Matrix4d t) {
446455
447456 /**
448457 * Transforms an atom object, given a Matrix4d (i.e. the vecmath library
449- * double-precision 4x4 rotation+translation matrix)
458+ * double-precision 4x4 rotation+translation matrix).
459+ * The transformation Matrix must be a post-multiplication Matrix.
460+ *
450461 * @param atom
451462 * @param m
452463 */
@@ -462,7 +473,9 @@ public static final void transform (Atom atom, Matrix4d m) {
462473
463474 /**
464475 * Transforms a group object, given a Matrix4d (i.e. the vecmath library
465- * double-precision 4x4 rotation+translation matrix)
476+ * double-precision 4x4 rotation+translation matrix).
477+ * The transformation Matrix must be a post-multiplication Matrix.
478+ *
466479 * @param group
467480 * @param m
468481 */
@@ -478,7 +491,9 @@ public static final void transform (Group group, Matrix4d m) {
478491
479492 /**
480493 * Transforms a structure object, given a Matrix4d (i.e. the vecmath library
481- * double-precision 4x4 rotation+translation matrix)
494+ * double-precision 4x4 rotation+translation matrix).
495+ * The transformation Matrix must be a post-multiplication Matrix.
496+ *
482497 * @param structure
483498 * @param m
484499 */
@@ -494,7 +509,9 @@ public static final void transform (Structure structure, Matrix4d m) {
494509
495510 /**
496511 * Transforms a chain object, given a Matrix4d (i.e. the vecmath library
497- * double-precision 4x4 rotation+translation matrix)
512+ * double-precision 4x4 rotation+translation matrix).
513+ * The transformation Matrix must be a post-multiplication Matrix.
514+ *
498515 * @param chain
499516 * @param m
500517 */
0 commit comments