;+
; NAME:
;	V4XSC2HC
; PURPOSE:
;	Convert Solar Cartesian to Heliographic Cartesian coordinates
;	(normally called by V4XFORM based on the v4xforms structure)
; CALLING SEQUENCE:
;	out = V4XCART2SPH(in,/verbose,index=ix,outdex=ox,ocoord=ocoord)
; INPUTS:
;	in - a V4 structure containing the co-ordinates to 
;	     transform
; RETURNS:
;	The transformed vector (or array)
; KEYWORDS:
;	VERBOSE - Be chatty
;	INDEX   - A 4-array that re-orders the input vector  (IGNORED)
;	OUTDEX  - A 4-array that re-orders the output vector (IGNORED)
;	OCOORD  - The coordinate system name for the output coordinates 
; 
; METHOD:
;	Calculate the B angle then apply a rotation matrix.
; AUTHOR:
;	Craig DeForest
; HISTORY: 
;	Initial implementation, 7-Oct-1997
;
;-
function V4XHC2SC,in,verbose=v,index=ix,outdex=ox,ocoords=ocoords

;;;
;;; Check out input keywords for existence...
;;;
if (isvalid(ix) or isvalid(ox)) then print,"WARNING - V4XHC2SC - ignoring indexing!"
v = keyword_set(v)

ix = [0,1,2,3]
ox = ix
iu = ix+5
ou = ox+5

;;;
;;; Find the B angle...
pbr = zpb0r(in.(ix(0)))
B = pbr(1,*)/!radeg
if nlm(b) eq 1 then b=b(0)

i2 = v4canon(in)

out = i2
out.coords="Solar Cartesian"
out.(ix(2)) =   i2.(ix(2))*cos(B) - i2.(ix(3))*sin(B)
out.(ix(3)) =   i2.(ix(2))*sin(B) + i2.(ix(3))*cos(B)

return,out
end
