FUNCTION ToRadians, degrees=Degrees ;+ ; NAME: ; ToRadians ; PURPOSE: ; Get conversion factor needed to convert angles to radians, ; depending on setting of keyword Degrees ; CATEGORY: ; Number strangling ; CALLING SEQUENCE: ; radians_per_mystery_unit = ToRadians(degrees=Degrees) ; OPTIONAL INPUT PARAMETERS: ; /degrees indicates whether input angles are in ; radians (not set) or degrees (set) ; OUTPUTS: ; radians_per_mystery_unit ; = 1.0 if Degrees not set ; = 1.0/!radeg if Degrees set ; Results is double precision ; INCLUDE: @compile_opt.pro ; On error, return to caller ; SEE ALSO: ; ToDegrees ; 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: ; JAN-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- D = keyword_set(Degrees) RETURN, D*!dpi/180.d0+(1-D)*1.0d0 & END