function oc_x2fp_rotmat, rec6 ;+ ; NAME: ; oc_x2fp_rotmat ; PURPOSE: (one line) ; Return the matrix for rotating XYZ to F'G'H ; DESCRIPTION: ; Return the matrix for rotating XYZ to F'G'H ; CATEGORY: ; Occultations ; CALLING SEQUENCE: ; R = oc_x2fp_rotmat(rec6) ; INPUTS: ; rec6 - 6-element rectangular position & velocity vector ; 0:2 R = [X,Y,Z], defined in the usual manner ; X = cos(ra_s) cos(dec_s) ; Y = sin(ra_s) cos(dec_s) ; Z = sin(dec_s) ; 3:5 V = [dX/dt, dY/dt, dZ/dt] ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; none ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; R - rotation matrix for rotating an XYZ vector to F'G'H ; XYZ are defined in the usual manner ; X = cos(ra_s) cos(dec_s) ; Y = sin(ra_s) cos(dec_s) ; Z = sin(dec_s) ; ; FGH are defined as in Elliot et al. 1993. Astron. J. 106, 2544-2572 ; H is toward the occultation star ; F is perpendicular to H and Z (Z x H) ; G completes the right hand system ; ; F' and G' are a rotated version of F and G, so that ; F' is the projection of the velocity vector onto the sky plane ; G' is the orbit normal, R x V ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; None ; PROCEDURE: ; The function returns the matrix ; -sin(ra) cos(ra) 0 ; -cos(ra) sin(dec) -sin(ra) sin(dec) cos(dec) ; cos(ra) cos(dec) sin(ra) cos(dec) sin(dec) ; ; USE: ; The matrix is defined so that ; fgh = R ## xyz ; fgh, xyz column vectors ; where fgh and xyz are column vectors (Array[1,3]) and ## is the ; IDL operator for ordinary matrix multiplication (inner product). ; It is usually more convenient to use xyz and fgh as row vectors ; (Array[3]). In this case we have ; fgh = transpose(R) # xyz ; fgh, xyz row vectors ; ; MODIFICATION HISTORY: ; 2005 Aug 19 Leslie A Young SwRI ; 2005 Dec 28, LAY. ; Added documentation, added function to $layoung/oc/. ;- r = rec6[0:2] v = rec6[3:5] h = normv(r) g = normv(crossp(r,v) ) f = crossp(g, h) rotmat = [ [f], [g], [h] ] return, rotmat end