function radec2xyz, radec ;+ ; NAME: ; radec2xyz ; PURPOSE: (one line) ; Convert from ra, dec to xyz ; DESCRIPTION: ; Convert from ra, dec to xyz ; CATEGORY: ; Astronomy ; CALLING SEQUENCE: ; xyz = radec2xyz(radec) ; INPUTS: ; radec - vector of [ra, dec] in radians ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; none ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; xyz - vector of [x,y,z] ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; None ; PROCEDURE: ; MODIFICATION HISTORY: ; Written 2000, by Leslie Young, SwRI ; 2005 Apr 26 do arithmatic in doubles ;- ra = double(radec[0]) dec = double(radec[1]) xyz = [cos(dec)*cos(ra), cos(dec)*sin(ra), sin(dec)] return, xyz end