View Javadoc

1   /*
2    * ITransform3D.java
3    */
4   
5   package org.lcsim.detector;
6   
7   import hep.physics.matrix.SymmetricMatrix;
8   import hep.physics.vec.Hep3Vector;
9   
10  /**
11   * An interface to a combined rotation and translation in 3D apce.
12   * 
13   * @author Tim Nelson <tknelson@slac.stanford.edu>
14   */
15  public interface ITransform3D
16  {
17      
18      /**
19       * Get Hep3Vector corresponding to translation
20       * @return translation Hep3Vector
21       */
22      public ITranslation3D getTranslation();
23      
24      /**
25       * Get IRotation3D corresponding to rotation
26       * @return rotation IRotation3D
27       */
28      public IRotation3D getRotation();
29      
30      // Transformations in place
31      //=========================
32      
33      /**
34       * Transform coordinates in place
35       * @param coordinates to transform
36       */
37      public void transform(Hep3Vector coordinates);
38      
39      /**
40       * Transform SymmetricMatrix in place (e.g. covariance)
41       * @param matrix to transform
42       */
43      public void transform(SymmetricMatrix matrix);
44      
45      /**
46       * Translate coordinates in place
47       * @param coordinates to translate
48       */
49      public void translate(Hep3Vector coordinates);
50      
51      /**
52       * Rotate coordinates in place
53       * @param coordinates to rotate
54       */
55      public void rotate(Hep3Vector coordinates);
56      
57      /**
58       * Rotate SymmetricMatrix in place (e.g. covariance)
59       * @param matrix to rotate
60       */
61      public void rotate(SymmetricMatrix matrix);
62      
63      // Transformations creating new position vectors
64      //==============================================
65      
66      /**
67       * Transform coordinates
68       * @param coordinates to transform
69       * @return transformed coordinates
70       */
71      public Hep3Vector transformed(Hep3Vector coordinates);
72      
73      /**
74       * Transform SymmetricMatrix (e.g. covariance)
75       * @param matrix to transform
76       * @return transformed matrix
77       */
78      public SymmetricMatrix transformed(SymmetricMatrix matrix);
79      
80      /**
81       * Translated coordinates
82       * @param coordinates to translate
83       * @return translated coordinates
84       */
85      public Hep3Vector translated(Hep3Vector coordinates);
86      
87      /**
88       * Rotate coordinates
89       * @param coordinates to rotate
90       * @return rotated coordinates
91       */
92      public Hep3Vector rotated(Hep3Vector coordinates);
93      
94      /**
95       * Rotate SymmetricMatrix (e.g. covariance)
96       * @param matrix to rotate
97       * @return rotated matrix
98       */
99      public SymmetricMatrix rotated(SymmetricMatrix matrix);
100     
101     /**
102      * Multply this by another transformation in place
103      * @param transformation to multiply by
104      */
105     public void multiplyBy(ITransform3D trans);
106     
107     /**
108      * Invert this transformation in place
109      */
110     public void invert();
111     
112     /**
113      * Get inverse of this transformation
114      * @ return inverted transformation
115      *
116      */
117     public Transform3D inverse();
118 }