class Poke::API::Geometry::S2LatLon

Public Class Methods

new(lat_degrees, lon_degrees) click to toggle source
# File lib/poke-api/geometry/s2_lat_lon.rb, line 5
def initialize(lat_degrees, lon_degrees)
  @lat = lat_degrees * Math::PI / 180
  @lon = lon_degrees * Math::PI / 180
end

Public Instance Methods

to_point() click to toggle source
# File lib/poke-api/geometry/s2_lat_lon.rb, line 10
def to_point
  phi    = @lat
  theta  = @lon
  cosphi = Math.cos(phi)
  S2Point.new(Math.cos(theta) * cosphi, Math.sin(theta) * cosphi, Math.sin(phi))
end