jsky.coords
Class Cotr

java.lang.Object
  extended by jsky.coords.Cotr

public class Cotr
extends java.lang.Object

Based on C routintes by Francois Ochsenbein [ESO-IPG].

The static methods provided in this class all deal with coordinate transformations. All spherical coordinates are assumed to be expressed in DEGREES. No function is traced. The parameter mnemonics are:

o
array [alpha, delta] of spherical coordinates, expressed in degrees.
R
3 x 3 Rotation (orthogonal) matrix from old to new coordinate frame
u
vector[x,y,z] of Unit (cosine) direction (x^2+y^2+z^2=1)


Constructor Summary
Cotr()
           
 
Method Summary
static void tr_Euler(double[] euler_angles, double[][] R)
          Compute the rotation matrix from Euler angles (z, theta, zeta).
static void tr_oo(double[] o, double[] o2, double[][] R)
          Rotate polar coordinates using an R rotation matrix (old to new frame) and unit vectors.
static void tr_oo1(double[] o, double[] o2, double[][] R)
          Rotate polar coordinates, using the inversed R matrix (new to old frame).
static void tr_oR(double[] o, double[][] R)
          Creates the rotation matrix R[3][3].
static void tr_ou(double[] o, double[] u)
          Transformation from polar coordinates to Unit vector.
static void tr_RR(double[][] A, double[][] B, double[][] R)
          Product of orthogonal matrices B = R * A.
static void tr_RR1(double[][] A, double[][] B, double[][] R)
          Product of orthogonal matrices B = R^{-1} * A.
static void tr_uo(double[] u, double[] o)
          Computes angles from direction cosines.
static void tr_uR(double[] u, double[][] R)
          Creates the rotation matrix.
static void tr_uu(double[] u1, double[] u2, double[][] R)
          Rotates the unit vector u1 to u2, as u_2 = R * u_1 (old to new frame)
static void tr_uu1(double[] u1, double[] u2, double[][] R)
          Rotates the unit vector u1 to u2, as u_2 = R^{-1} * u_1 (new to old frame).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cotr

public Cotr()
Method Detail

tr_Euler

public static void tr_Euler(double[] euler_angles,
                            double[][] R)
Compute the rotation matrix from Euler angles (z, theta, zeta). This rotation matrix is actually defined by R = R_z(-z) * R_y(theta) * R_z(-zeta) (from old to new frame).

Parameters:
euler_angles - IN: Euler angles (z, theta, zeta)
R - OUT: rotation matrix

tr_oo

public static void tr_oo(double[] o,
                         double[] o2,
                         double[][] R)
Rotate polar coordinates using an R rotation matrix (old to new frame) and unit vectors.

Parameters:
o - IN: Original angles
o2 - OUT: rotated angles
R - IN: Rotation matrix

tr_oo1

public static void tr_oo1(double[] o,
                          double[] o2,
                          double[][] R)
Rotate polar coordinates, using the inversed R matrix (new to old frame). Use unit vectors

Parameters:
o - IN: Original angles
o2 - OUT: rotated angles
R - IN: Rotation matrix

tr_oR

public static void tr_oR(double[] o,
                         double[][] R)
Creates the rotation matrix R[3][3]. R[3][3] is defined as:

R[0]
(first row) = unit vector towards Zenith
R[1]
(second row) = unit vector towards East
R[2]
(third row) = unit vector towards North

The resulting R matrix can then be used to get the components of a vector v in the local frame.

Parameters:
o - IN: original angles
R - OUT: rotation matrix

tr_ou

public static void tr_ou(double[] o,
                         double[] u)
Transformation from polar coordinates to Unit vector.

Parameters:
o - IN: angles ra + dec in degrees
u - OUT: dir cosines

tr_uo

public static void tr_uo(double[] u,
                         double[] o)
Computes angles from direction cosines.

Parameters:
u - IN: Dir cosines
o - OUT: Angles ra + dec in degrees

tr_uR

public static void tr_uR(double[] u,
                         double[][] R)
Creates the rotation matrix. Creates the rotation matrix R[3][3] with

R[0]
(first row) = unit vector towards Zenith
R[1]
(second row) = unit vector towards East
R[2]
(third row) = unit vector towards North

For the poles,(|z|=1), the rotation axis is assumed be the y axis, i.e. the right ascension is assumed to be 0.

Parameters:
u - IN: Original direction
R - OUT: Rotation matrix

tr_uu

public static void tr_uu(double[] u1,
                         double[] u2,
                         double[][] R)
Rotates the unit vector u1 to u2, as u_2 = R * u_1 (old to new frame)

Parameters:
u1 - IN: Unit vector
u2 - OUT: Resulting unit vector after rotation
R - IN: rotation matrix (e.g. created by tr_oR)

tr_uu1

public static void tr_uu1(double[] u1,
                          double[] u2,
                          double[][] R)
Rotates the unit vector u1 to u2, as u_2 = R^{-1} * u_1 (new to old frame).

Parameters:
u1 - IN: Unit vector
u2 - OUT: Resulting unit vector after rotation
R - IN: rotation matrix (e.g. created by tr_oR)

tr_RR

public static void tr_RR(double[][] A,
                         double[][] B,
                         double[][] R)
Product of orthogonal matrices B = R * A.

Parameters:
A - IN: First Matrix
B - OUT: Result Matrix
R - IN: Rotation Matrix

tr_RR1

public static void tr_RR1(double[][] A,
                          double[][] B,
                          double[][] R)
Product of orthogonal matrices B = R^{-1} * A.

Parameters:
A - IN: First Matrix
B - OUT: Result Matrix
R - IN: Rotation Matrix