# cirrange¶

cirrange(number[, max]) → restricted_number

## Purpose¶

Force a number into a given range $$[0, \text{max})$$.

## Argument¶

• number: the number to modify. Can be a scalar or an array.
• max (optional numerical argument): specify the extremum of the range $$[0, \text{max})$$ into which the number should be restricted. If omitted, defaults to 360.0.

## Output¶

The converted number or array of numbers, as AbstractFloat.

## Example¶

Restrict an array of numbers in the range $$[0, 2\pi)$$ as if they are angles expressed in radians:

cirrange([4pi, 10, -5.23], 2.0*pi)
# => 3-element Array{Float64,1}:
#     0.0
#     3.71681
#     1.05319


## Notes¶

This function does not support the radians keyword like IDL implementation. Use 2.0*pi as second argument to restrict a number to the same interval.

Code of this function is based on IDL Astronomy User’s Library.

rad2sec(rad) → seconds

## Argument¶

• rad: number of radians. It can be either a scalar or a vector.

## Output¶

The number of seconds corresponding to rad. If rad is an array, an array of the same length is returned.

## Example¶

rad2sec(1)
# => 206264.80624709636


## Notes¶

Use sec2rad to convert seconds to radians.

sec2rad(sec) → radians

## Argument¶

• sec: number of seconds. It can be either a scalar or a vector.

## Output¶

The number of radians corresponding to sec. If sec is an array, an array of the same length is returned.

## Example¶

sec2rad(3600*30)
# => 0.5235987755982988


## Notes¶

Use rad2sec to convert radians to seconds.