Class: GeoPoint
- Inherits:
-
Object
- Object
- GeoPoint
- Includes:
- GeoCalc, GeoVector::Macros
- Defined in:
- lib/geo_vectors/geo_point.rb,
lib/geo_vectors/macros.rb
Overview
extends GeoPoint with methods to add and subtract vectors etc.
Instance Method Summary collapse
- #+(*args) ⇒ Object (also: #add, #<<)
- #-(*args) ⇒ Object (also: #sub)
- #add!(*args) ⇒ Object
- #geo_point ⇒ Object
- #sub!(*args) ⇒ Object
- #vector ⇒ Object
Methods included from GeoVector::Macros
Instance Method Details
#+(*args) ⇒ Object Also known as: add, <<
5 6 7 |
# File 'lib/geo_vectors/geo_point.rb', line 5 def + *args self.dup.add! *args end |
#-(*args) ⇒ Object Also known as: sub
16 17 18 |
# File 'lib/geo_vectors/geo_point.rb', line 16 def - *args self.dup.sub! *args end |
#add!(*args) ⇒ Object
11 12 13 14 |
# File 'lib/geo_vectors/geo_point.rb', line 11 def add! *args vec = GeoVector::Parser.create_vector *args vec.add_to_point! self end |
#geo_point ⇒ Object
30 31 32 |
# File 'lib/geo_vectors/geo_point.rb', line 30 def geo_point self end |
#sub!(*args) ⇒ Object
21 22 23 24 |
# File 'lib/geo_vectors/geo_point.rb', line 21 def sub! *args vec = GeoVector::Parser.create_vector *args vec.sub_from_point! self end |
#vector ⇒ Object
26 27 28 |
# File 'lib/geo_vectors/geo_point.rb', line 26 def vector to_lat_lng.vector end |