struct S2Cells::LatLng
- S2Cells::LatLng
- Struct
- Value
- Object
Defined in:
s2_cells/lat_lng.crConstructors
-
.default : LatLng
Creates a default LatLng (0, 0).
-
.from_angles(lat : Angle, lng : Angle) : LatLng
Creates a LatLng from two angles.
-
.from_degrees(lat : Float64, lng : Float64) : LatLng
Creates a LatLng from degrees.
-
.from_point(point : Point) : LatLng
Creates a LatLng from a Point object.
-
.from_radians(lat : Float64, lng : Float64) : LatLng
Creates a LatLng from radians.
-
.invalid : LatLng
Creates an invalid LatLng.
-
.new(lat : Float64, lng : Float64)
Initializes a LatLng with latitude and longitude in radians.
Class Method Summary
-
.latitude(point : Point) : Angle
Static method to calculate latitude from a Point.
-
.longitude(point : Point) : Angle
Static method to calculate longitude from a Point.
Instance Method Summary
-
#!=(other : LatLng) : Bool
Checks inequality of LatLng with another LatLng.
-
#*(scalar : Float64) : LatLng
Multiplies LatLng by a scalar.
-
#+(other : LatLng) : LatLng
Adds two LatLng objects.
-
#-(other : LatLng) : LatLng
Subtracts one LatLng from another.
-
#==(other : LatLng) : Bool
Checks equality of LatLng with another LatLng.
-
#approx_equals(other : LatLng, max_error : Float64 = 1e-15) : Bool
Checks if two LatLng objects are approximately equal.
-
#get_distance(other : LatLng) : Angle
Calculates the great-circle distance between two LatLng objects.
-
#hash : Int32
Returns the hash code of LatLng.
-
#lat : Angle
Returns the latitude as an Angle.
-
#lng : Angle
Returns the longitude as an Angle.
-
#normalized : LatLng
Normalizes the LatLng.
-
#to_point : Point
Converts LatLng to a Point.
-
#to_s : String
Returns the string representation of LatLng.
-
#valid? : Bool
Checks if the LatLng is valid.
Constructor Detail
Creates a LatLng from two angles.
Creates a LatLng from degrees.
Creates a LatLng from radians.
Initializes a LatLng with latitude and longitude in radians.
Class Method Detail
Static method to calculate latitude from a Point.
Static method to calculate longitude from a Point.
Instance Method Detail
Checks if two LatLng objects are approximately equal.
Calculates the great-circle distance between two LatLng objects.