module Pokeplot module Helpers class Math class << self def deg_to_rad(deg) return deg * (::Math::PI / 180) end def get_earth_radius(lat) earth_radius_max = 6378137.0 earth_radius_min = 6356752.3 latrad = deg_to_rad(lat) return (1.0/(((::Math.cos(latrad))/earth_radius_max)**(2) + ((::Math.sin(latrad))/earth_radius_min)**(2)))**(1.0/2) end end end end end