class Haversine::Distance

Included Modules

Defined in:

haversine/distance.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(distance : Number) #

Class Method Detail

def self.zero : Haversine::Distance #

Instance Method Detail

Adds the value of self to other.


Removes the value of other from self.


def <=>(other : Haversine::Distance) #
Description copied from module Comparable(Haversine::Distance)

The comparison operator. Returns 0 if the two objects are equal, a negative number if this object is considered less than other, a positive number if this object is considered greater than other, or nil if the two objects are not comparable.

Subclasses define this method to provide class-specific ordering.

The comparison operator is usually used to sort values:

# Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]

# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3]

def distance : Float32 | Float64 | Int32 #

def distance=(distance : Float32 | Float64 | Int32) #

def to_centimeters : Number #

def to_centimetres : Number #

def to_degrees : Number #

def to_feet : Number #

def to_inches : Number #

def to_kilometers : Number #

def to_kilometres : Number #

def to_meters : Number #

def to_metres : Number #

def to_miles : Number #

def to_millimeters : Number #

def to_millimetres : Number #

def to_nautical_miles : Number #

def to_radians : Number #

def to_yards : Number #