Class: Geodesics::Point
- Inherits:
-
Object
- Object
- Geodesics::Point
- Defined in:
- lib/geodesics/point.rb
Constant Summary collapse
- RADIAN =
Math::PI / 180
- DEGREE =
180 / Math::PI
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(latitude, longitude) ⇒ Point
constructor
A new instance of Point.
- #to_degree ⇒ Object
- #to_radian ⇒ Object
Constructor Details
#initialize(latitude, longitude) ⇒ Point
Returns a new instance of Point.
10 11 12 13 |
# File 'lib/geodesics/point.rb', line 10 def initialize(latitude, longitude) @latitude = latitude @longitude = longitude end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
8 9 10 |
# File 'lib/geodesics/point.rb', line 8 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
8 9 10 |
# File 'lib/geodesics/point.rb', line 8 def longitude @longitude end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/geodesics/point.rb', line 15 def ==(other) latitude == other.latitude && longitude == other.longitude end |
#to_degree ⇒ Object
23 24 25 |
# File 'lib/geodesics/point.rb', line 23 def to_degree self end |
#to_radian ⇒ Object
19 20 21 |
# File 'lib/geodesics/point.rb', line 19 def to_radian self end |