class Geometry::Point
Public Class Methods
new_by_array(array)
click to toggle source
# File lib/geometry/point.rb, line 3 def self.new_by_array(array) self.new(array[0], array[1]) end
Public Instance Methods
==(another_point)
click to toggle source
# File lib/geometry/point.rb, line 7 def ==(another_point) x === another_point.x && y === another_point.y end
advance_by(vector)
click to toggle source
# File lib/geometry/point.rb, line 15 def advance_by(vector) Point x + vector.x, y + vector.y end
distance_to(point)
click to toggle source
# File lib/geometry/point.rb, line 19 def distance_to(point) Geometry.distance(self, point) end
to_vector()
click to toggle source
# File lib/geometry/point.rb, line 11 def to_vector Vector.new(x, y) end