FUNCTION ToDegrees, degrees=Degrees ;+ ; NAME: ; ToDegrees ; PURPOSE: ; Get conversion factor needed to convert angles to degrees, ; depending on setting of keyword Degrees ; CATEGORY: ; Number strangling ; CALLING SEQUENCE: ; degrees_per_mystery_unit = ToRadians(degrees=Degrees) ; OPTIONAL INPUT PARAMETERS: ; /degrees indicates whether input angles are in ; radians (not set) or degrees (set) ; OUTPUTS: ; degrees_per_mystery_unit ; = !radeg if Degrees not set ; = 1.0 if Degrees set ; Result is returned in double precision ; INCLUDE: @compile_opt.pro ; On error, return to caller ; SEE ALSO: ; ToRadians ; PROCEDURE: ; Many procedures which process angles allow the keyword /Degrees ; to indicate that the input and/or output angles are in degrees, ; rather than the default radians. This function returns the ; conversion factor required to convert to radians. Usually ; this function is used at the beginning of the procedure to convert ; all angles from the input units to radians, and at the end to convert ; back from radians to the input units. ; MODIFICATION HISTORY: ; SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- D = keyword_set(Degrees) RETURN, D*1.0d0+(1B-D)*180.0d0/!dpi & END