Method: RGeo::Cartesian::PointMethods#distance
- Defined in:
- lib/rgeo/cartesian/feature_methods.rb
#distance(rhs) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rgeo/cartesian/feature_methods.rb', line 44 def distance(rhs) rhs = RGeo::Feature.cast(rhs, @factory) case rhs when PointImpl dx = @x - rhs.x dy = @y - rhs.y Math.sqrt(dx * dx + dy * dy) else super end end |