struct

S2Cells::LatLng

Inherits Struct < Value < Object

Constructors

default

Creates a default LatLng (0, 0).

Source
from_angles(lat : Angle, lng : Angle) : LatLng

Creates a LatLng from two angles.

Source
from_degrees(lat : Float64, lng : Float64) : LatLng

Creates a LatLng from degrees.

Source
from_point(point : Point) : LatLng

Creates a LatLng from a Point object.

Source
from_radians(lat : Float64, lng : Float64) : LatLng

Creates a LatLng from radians.

Source
invalid

Creates an invalid LatLng.

Source
new(lat : Float64, lng : Float64)

Initializes a LatLng with latitude and longitude in radians.

Source

Class methods

latitude(point : Point) : Angle

Static method to calculate latitude from a Point.

Source
longitude(point : Point) : Angle

Static method to calculate longitude from a Point.

Source

Instance methods

!=(other : LatLng) : Bool

Checks inequality of LatLng with another LatLng.

Source
*(scalar : Float64) : LatLng

Multiplies LatLng by a scalar.

Source
+(other : LatLng) : LatLng

Adds two LatLng objects.

Source
-(other : LatLng) : LatLng

Subtracts one LatLng from another.

Source
==(other : LatLng) : Bool

Checks equality of LatLng with another LatLng.

Source
approx_equals(other : LatLng, max_error : Float64 = 1e-15) : Bool

Checks if two LatLng objects are approximately equal.

Source
get_distance(other : LatLng) : Angle

Calculates the great-circle distance between two LatLng objects.

Source
hash

Returns the hash code of LatLng.

Source
lat

Returns the latitude as an Angle.

Source
lng

Returns the longitude as an Angle.

Source
normalized

Normalizes the LatLng.

Source
to_point

Converts LatLng to a Point.

Source
to_s

Returns the string representation of LatLng.

Source
valid?

Checks if the LatLng is valid.

Source