Home | History | Annotate | Download | only in geometry

Lines Matching defs:Rotation

34  * user can build a rotation from any of these representations, and
36 * <code>Rotation</code> instance (see the various constructors and
37 * getters). In addition, a rotation can also be built implicitly
40 * representation to another one. For example, converting a rotation
44 * double[] angles = new Rotation(matrix, 1.0e-10).getAngles(RotationOrder.XYZ);
46 * <p>Focus is oriented on what a rotation <em>do</em> rather than on its
48 * internal representation, a rotation is an <em>operator</em> which basically
51 * meaning of these vectors may vary and the semantics of the rotation also.</p>
54 * frames change. The rotation transforms the coordinates of the vector in inertial
56 * case, the rotation implicitly defines the relation between the two frames.</p>
57 * <p>Another example could be a telescope control application, where the rotation
60 * case the rotation transforms the direction at rest in a topocentric frame
66 * location and the Earth rotation, which would essentially be an application of the
69 * <p>These examples show that a rotation is what the user wants it to be. This
76 * <p>Since a rotation is basically a vectorial operator, several rotations can be
79 * <code>r(u) = r<sub>1</sub>(r<sub>2</sub>(u))</code>) is also a rotation. Hence
80 * we can consider that in addition to vectors, a rotation can be applied to other
84 * class provides the methods: {@link #applyTo(Rotation) applyTo(Rotation)} and
85 * {@link #applyInverseTo(Rotation) applyInverseTo(Rotation)}.</p>
95 public class Rotation implements Serializable {
97 /** Identity rotation. */
98 public static final Rotation IDENTITY = new Rotation(1.0, 0.0, 0.0, 0.0, false);
115 /** Build a rotation from the quaternion coordinates.
116 * <p>A rotation can be built from a <em>normalized</em> quaternion,
133 public Rotation(double q0, double q1, double q2, double q3,
152 /** Build a rotation from an axis and an angle.
154 * the effect of the rotation on vectors around the axis. That means
159 * <p>Another way to represent our convention is to say that a rotation
161 * rotation build from quaternion components { cos(-&theta;/2),
170 * @param angle rotation angle.
173 public Rotation(Vector3D axis, double angle) {
190 /** Build a rotation from a 3X3 matrix.
192 * <p>Rotation matrices are orthogonal matrices, i.e. unit matrices
196 * positive determinant (+1) are rotation matrices.</p>
198 * <p>When a rotation is defined by a matrix with truncated values
206 * true rotation matrix and an exception is thrown.<p>
208 * @param m rotation matrix
220 public Rotation(double[][] m, double threshold)
295 /** Build the rotation that transforms a pair of vector into another pair.
309 * @param v1 desired image of u1 by the rotation
310 * @param v2 desired image of u2 by the rotation
313 public Rotation(Vector3D u1, Vector3D u2, Vector3D v1, Vector3D v2) {
403 // this is really the identity rotation
442 * arbitrary rotation axis is chosen.</p>
445 * @param v desired image of u by the rotation
448 public Rotation(Vector3D u, Vector3D v) {
458 // special case u = -v: we select a PI angle rotation around
467 // the shortest possible rotation: axis orthogonal to this plane
477 /** Build a rotation from three Cardan or Euler elementary rotations.
492 * @param alpha1 angle of the first elementary rotation
493 * @param alpha2 angle of the second elementary rotation
494 * @param alpha3 angle of the third elementary rotation
496 public Rotation(RotationOrder order,
498 Rotation r1 = new Rotation(order.getA1(), alpha1);
499 Rotation r2 = new Rotation(order.getA2(), alpha2);
500 Rotation r3 = new Rotation(order.getA3(), alpha3);
501 Rotation composed = r1.applyTo(r2.applyTo(r3));
508 /** Revert a rotation.
509 * Build a rotation which reverse the effect of another
510 * rotation. This means that if r(u) = v, then r.revert(v) = u. The
512 * @return a new rotation whose effect is the reverse of the effect
515 public Rotation revert() {
516 return new Rotation(-q0, q1, q2, q3, false);
547 /** Get the normalized axis of the rotation.
548 * @return normalized axis of the rotation
549 * @see #Rotation(Vector3D, double)
563 /** Get the angle of the rotation.
564 * @return angle of the rotation (between 0 and &pi;)
565 * @see #Rotation(Vector3D, double)
578 * <p>The equations show that each rotation can be defined by two
580 * if Cardan angles are used, the rotation defined by the angles
582 * the rotation defined by the angles &pi; + a<sub>1</sub>, &pi;
596 * rotation order, it will be impossible to retrieve the angles. For
600 * rotation itself, which is perfectly well defined). For Cardan
604 * rotation is always singular for Euler angles!</p>
606 * @param order rotation order to use
608 * @exception CardanEulerSingularityException if the rotation is
873 /** Apply the rotation to a vector.
874 * @param u vector to apply the rotation to
875 * @return a new vector which is the image of u by the rotation
891 /** Apply the inverse of the rotation to a vector.
892 * @param u vector to apply the inverse of the rotation to
893 * @return a new vector which such that u is its image by the rotation
910 /** Apply the instance to another rotation.
911 * Applying the instance to a rotation is computing the composition
916 * @param r rotation to apply the rotation to
917 * @return a new rotation which is the composition of r by the instance
919 public Rotation applyTo(Rotation r) {
920 return new Rotation(r.q0 * q0 - (r.q1 * q1 + r.q2 * q2 + r.q3 * q3),
927 /** Apply the inverse of the instance to another rotation.
928 * Applying the inverse of the instance to a rotation is computing
934 * @param r rotation to apply the rotation to
935 * @return a new rotation which is the composition of r by the inverse
938 public Rotation applyInverseTo(Rotation r) {
939 return new Rotation(-r.q0 * q0 - (r.q1 * q1 + r.q2 * q2 + r.q3 * q3),
1048 * the rotation r that prepended to one of the rotations gives the other
1062 * and (-0.36, -0.48, 0.48, 0.64) represent exactly the same rotation despite
1064 * @param r1 first rotation
1065 * @param r2 second rotation
1068 public static double distance(Rotation r1, Rotation r2) {