diff --git a/lib/geocoder/calculations.rb b/lib/geocoder/calculations.rb index 77c4744916e8dabaa0de6bf98372b017701b7898..dcf8971a650c4d65596011c0ef32b132b743fec9 100644 --- a/lib/geocoder/calculations.rb +++ b/lib/geocoder/calculations.rb @@ -116,9 +116,15 @@ module Geocoder ## # Convert radians to degrees. + # If an array is passed, converts each value and returns array. # - def to_degrees(radians) - (radians * 180.0) / Math::PI + def to_degrees(*args) + args = args.first if args.first.is_a?(Array) + if args.size == 1 + (args.first * 180.0) / Math::PI + else + args.map{ |i| to_degrees(i) } + end end ##