struct S2Cells::LatLng

Defined in:

s2_cells/lat_lng.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.default : LatLng #

Creates a default LatLng (0, 0).


[View source]
def self.from_angles(lat : Angle, lng : Angle) : LatLng #

Creates a LatLng from two angles.


[View source]
def self.from_degrees(lat : Float64, lng : Float64) : LatLng #

Creates a LatLng from degrees.


[View source]
def self.from_point(point : Point) : LatLng #

Creates a LatLng from a Point object.


[View source]
def self.from_radians(lat : Float64, lng : Float64) : LatLng #

Creates a LatLng from radians.


[View source]
def self.invalid : LatLng #

Creates an invalid LatLng.


[View source]
def self.new(lat : Float64, lng : Float64) #

Initializes a LatLng with latitude and longitude in radians.


[View source]

Class Method Detail

def self.latitude(point : Point) : Angle #

Static method to calculate latitude from a Point.


[View source]
def self.longitude(point : Point) : Angle #

Static method to calculate longitude from a Point.


[View source]

Instance Method Detail

def !=(other : LatLng) : Bool #

Checks inequality of LatLng with another LatLng.


[View source]
def *(scalar : Float64) : LatLng #

Multiplies LatLng by a scalar.


[View source]
def +(other : LatLng) : LatLng #

Adds two LatLng objects.


[View source]
def -(other : LatLng) : LatLng #

Subtracts one LatLng from another.


[View source]
def ==(other : LatLng) : Bool #

Checks equality of LatLng with another LatLng.


[View source]
def approx_equals(other : LatLng, max_error : Float64 = 1e-15) : Bool #

Checks if two LatLng objects are approximately equal.


[View source]
def get_distance(other : LatLng) : Angle #

Calculates the great-circle distance between two LatLng objects.


[View source]
def hash : Int32 #

Returns the hash code of LatLng.


[View source]
def lat : Angle #

Returns the latitude as an Angle.


[View source]
def lng : Angle #

Returns the longitude as an Angle.


[View source]
def normalized : LatLng #

Normalizes the LatLng.


[View source]
def to_point : Point #

Converts LatLng to a Point.


[View source]
def to_s : String #

Returns the string representation of LatLng.


[View source]
def valid? : Bool #

Checks if the LatLng is valid.


[View source]