JAL-3541 selectively merged build.gradle and gradle.properties
[jalview.git] / src / jalview / math / RotatableMatrix.java
index 602c5e4..f3bf436 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.math;
 
 import jalview.datamodel.Point;
 
+import java.io.PrintStream;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -57,7 +58,7 @@ public class RotatableMatrix
   public enum Axis
   {
     X, Y, Z
-  };
+  }
 
   float[][] matrix;
 
@@ -101,16 +102,11 @@ public class RotatableMatrix
   /**
    * Prints the matrix in rows of space-delimited values
    */
-  public void print()
+  public void print(PrintStream ps)
   {
-    System.out.println(
-            matrix[0][0] + " " + matrix[0][1] + " " + matrix[0][2]);
-
-    System.out.println(
-            matrix[1][0] + " " + matrix[1][1] + " " + matrix[1][2]);
-
-    System.out.println(
-            matrix[2][0] + " " + matrix[2][1] + " " + matrix[2][2]);
+    ps.println(matrix[0][0] + " " + matrix[0][1] + " " + matrix[0][2]);
+    ps.println(matrix[1][0] + " " + matrix[1][1] + " " + matrix[1][2]);
+    ps.println(matrix[2][0] + " " + matrix[2][1] + " " + matrix[2][2]);
   }
 
   /**
@@ -248,74 +244,6 @@ public class RotatableMatrix
   }
 
   /**
-   * DOCUMENT ME!
-   * 
-   * @param args
-   *          DOCUMENT ME!
-   */
-  public static void main(String[] args)
-  {
-    RotatableMatrix m = new RotatableMatrix();
-
-    m.setValue(0, 0, 1);
-
-    m.setValue(0, 1, 0);
-
-    m.setValue(0, 2, 0);
-
-    m.setValue(1, 0, 0);
-
-    m.setValue(1, 1, 2);
-
-    m.setValue(1, 2, 0);
-
-    m.setValue(2, 0, 0);
-
-    m.setValue(2, 1, 0);
-
-    m.setValue(2, 2, 1);
-
-    m.print();
-
-    RotatableMatrix n = new RotatableMatrix();
-
-    n.setValue(0, 0, 2);
-
-    n.setValue(0, 1, 1);
-
-    n.setValue(0, 2, 1);
-
-    n.setValue(1, 0, 2);
-
-    n.setValue(1, 1, 1);
-
-    n.setValue(1, 2, 1);
-
-    n.setValue(2, 0, 2);
-
-    n.setValue(2, 1, 1);
-
-    n.setValue(2, 2, 1);
-
-    n.print();
-
-    // m.postMultiply(n.matrix);
-    // m.print();
-    // m.rotate(45,'z',new RotatableMatrix(3,3));
-    float[] vect = new float[3];
-
-    vect[0] = 2;
-
-    vect[1] = 4;
-
-    vect[2] = 6;
-
-    vect = m.vectorMultiply(vect);
-
-    System.out.println(vect[0] + " " + vect[1] + " " + vect[2]);
-  }
-
-  /**
    * Performs a vector multiplication whose result is the Point representing the
    * input point's value vector post-multiplied by this matrix.
    *