GeomConverter/src/org/lcsim/detector/kernel
diff -u -r1.1 -r1.2
--- Rotation3D.java 23 Feb 2007 21:44:37 -0000 1.1
+++ Rotation3D.java 24 Feb 2007 00:30:06 -0000 1.2
@@ -89,12 +89,11 @@
{
double sin = Math.sin(angle);
double cos = Math.cos(angle);
- //Hep3Rotation rotation = new Hep3Rotation();
- BasicHep3Matrix rotation = new BasicHep3Matrix();
- rotation.setElement(0,0,cos);
- rotation.setElement(0,1,sin);
- rotation.setElement(1,0,-sin);
+ BasicHep3Matrix rotation = BasicHep3Matrix.identity();
rotation.setElement(1,1,cos);
+ rotation.setElement(1,2,sin);
+ rotation.setElement(2,1,-sin);
+ rotation.setElement(2,2,cos);
return rotation;
}
@@ -102,18 +101,10 @@
{
double sin = Math.sin(angle);
double cos = Math.cos(angle);
- //Hep3Rotation rotation = new Hep3Rotation();
- BasicHep3Matrix rotation = new BasicHep3Matrix();
-
- // FIXME: Off by 1 error! Indexed from 0.
- //rotation.setElement(1,3,-sin);
- //rotation.setElement(3,1,sin);
- //rotation.setElement(3,3,cos);
-
- // FIXME: Is this correct?
- rotation.setElement(1,1,cos);
- rotation.setElement(1,2,sin);
- rotation.setElement(2,1,-sin);
+ BasicHep3Matrix rotation = BasicHep3Matrix.identity();
+ rotation.setElement(0,0,cos);
+ rotation.setElement(0,2,sin);
+ rotation.setElement(2,0,-sin);
rotation.setElement(2,2,cos);
return rotation;
}
@@ -122,8 +113,7 @@
{
double sin = Math.sin(angle);
double cos = Math.cos(angle);
- //Hep3Rotation rotation = new Hep3Rotation();
- BasicHep3Matrix rotation = new BasicHep3Matrix();
+ BasicHep3Matrix rotation = BasicHep3Matrix.identity();
rotation.setElement(0,0,cos);
rotation.setElement(0,1,sin);
rotation.setElement(1,0,-sin);
@@ -133,7 +123,7 @@
public void invert()
{
- matrix.invert();
+ matrix.transpose();
}
public double xx()