Method: Geocoder::Calculations#to_radians

Defined in:
lib/geocoder/calculations.rb

#to_radians(*args) ⇒ Object

Convert degrees to radians. If an array (or multiple arguments) is passed, converts each value and returns array.



296
297
298
299
300
301
302
303
# File 'lib/geocoder/calculations.rb', line 296

def to_radians(*args)
  args = args.first if args.first.is_a?(Array)
  if args.size == 1
    args.first * (Math::PI / 180)
  else
    args.map{ |i| to_radians(i) }
  end
end