updates for 0.9.4
[debian/openrocket] / src / net / sf / openrocket / util / Transformation.java
index d263c42ca49acf3ed343138e102c29ed5c620d87..2c54697409da1b9ab6cd8baba4a13ce7c0722238 100644 (file)
@@ -1,6 +1,8 @@
 package net.sf.openrocket.util;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
 /**
  * Defines an affine transformation of the form  A*x+c,  where x and c are Coordinates and
@@ -241,6 +243,20 @@ public class Transformation implements java.io.Serializable {
        }
        
        
+       @Override
+       public boolean equals(Object other) {
+               if (!(other instanceof Transformation))
+                       return false;
+               Transformation o = (Transformation)other;
+               for (int i=0; i<3; i++) {
+                       for (int j=0; j<3; j++) {
+                               if (!MathUtil.equals(this.rotation[i][j], o.rotation[i][j]))
+                                       return false;
+                       }
+               }
+               return this.translate.equals(o.translate);
+       }
+       
        public static void main(String[] arg) {
                Transformation t;