JAL-4059 update Jmol and JSmol to 15.2.69 - revised Jalview classes interating with...
[jalview.git] / src / mc_view / MCMatrix.java
index 01be1f9..61c46cc 100755 (executable)
@@ -22,31 +22,31 @@ package mc_view;
 
 public class MCMatrix
 {
-  float[][] matrix;
+  double[][] matrix;
 
-  float[][] tmp;
+  double[][] tmp;
 
-  float mycos;
+  double mycos;
 
-  float mysin;
+  double mysin;
 
-  float myconst = (float) (Math.PI / 180);
+  double myconst = Math.PI / 180;
 
   public MCMatrix(int rows, int cols)
   {
-    matrix = new float[rows][cols];
-    tmp = new float[rows][cols];
+    matrix = new double[rows][cols];
+    tmp = new double[rows][cols];
   }
 
-  public void addElement(int i, int j, float value)
+  public void addElement(int i, int j, double value)
   {
     matrix[i][j] = value;
   }
 
-  public void rotatex(float degrees)
+  public void rotatex(double degrees)
   {
-    mycos = (float) (Math.cos(degrees * myconst));
-    mysin = (float) (Math.sin(degrees * myconst));
+    mycos = (Math.cos(degrees * myconst));
+    mysin = (Math.sin(degrees * myconst));
 
     tmp[0][0] = 1;
     tmp[0][1] = 0;
@@ -60,10 +60,10 @@ public class MCMatrix
     preMultiply(tmp);
   }
 
-  public void rotatez(float degrees)
+  public void rotatez(double degrees)
   {
-    mycos = (float) (Math.cos(degrees * myconst));
-    mysin = (float) (Math.sin(degrees * myconst));
+    mycos = (Math.cos(degrees * myconst));
+    mysin = (Math.sin(degrees * myconst));
 
     tmp[0][0] = mycos;
     tmp[0][1] = -mysin;
@@ -78,10 +78,10 @@ public class MCMatrix
     preMultiply(tmp);
   }
 
-  public void rotatey(float degrees)
+  public void rotatey(double degrees)
   {
-    mycos = (float) (Math.cos(degrees * myconst));
-    mysin = (float) (Math.sin(degrees * myconst));
+    mycos = (Math.cos(degrees * myconst));
+    mysin = (Math.sin(degrees * myconst));
 
     tmp[0][0] = mycos;
     tmp[0][1] = 0;
@@ -96,9 +96,9 @@ public class MCMatrix
     preMultiply(tmp);
   }
 
-  public float[] vectorMultiply(float[] vect)
+  public double[] vectorMultiply(double[] vect)
   {
-    float[] temp = new float[3];
+    double[] temp = new double[3];
 
     temp[0] = vect[0];
     temp[1] = vect[1];
@@ -106,9 +106,8 @@ public class MCMatrix
 
     for (int i = 0; i < 3; i++)
     {
-      temp[i] = ((float) matrix[i][0] * vect[0])
-              + ((float) matrix[i][1] * vect[1])
-              + ((float) matrix[i][2] * vect[2]);
+      temp[i] = (matrix[i][0] * vect[0]) + (matrix[i][1] * vect[1])
+              + (matrix[i][2] * vect[2]);
     }
 
     vect[0] = temp[0];
@@ -118,9 +117,9 @@ public class MCMatrix
     return vect;
   }
 
-  public void preMultiply(float[][] mat)
+  public void preMultiply(double[][] mat)
   {
-    float[][] tmp = new float[3][3];
+    double[][] tmp = new double[3][3];
 
     for (int i = 0; i < 3; i++)
     {
@@ -140,9 +139,9 @@ public class MCMatrix
     }
   }
 
-  public void postMultiply(float[][] mat)
+  public void postMultiply(double[][] mat)
   {
-    float[][] tmp = new float[3][3];
+    double[][] tmp = new double[3][3];
 
     for (int i = 0; i < 3; i++)
     {