R/cirrange.R

cirrange = function( ang, radians=FALSE) {

                                        #  determine the additive constant.

  if(radians)
    cnst = pi * 2 
  else
    cnst = 360

                                        # deal with the lower limit.

  ang = ang %% cnst

                                        # deal with negative values, if any
  
  neg = which(ang < 0)
  ang[neg] = ang[neg] + cnst
  
  return(ang)
}

Try the astrolibR package in your browser

Any scripts or data that you put into this service are public.

astrolibR documentation built on May 2, 2019, 3:26 a.m.