class GeometricBoundingBox

Public Class Methods

new_by_arrays(point1_coordinates, point2_coordinates) click to toggle source
# File lib/flash_math/modules/geometry/geometric_bounding_box.rb, line 3
def self.new_by_arrays(point1_coordinates, point2_coordinates)
  self.new(GeometricPoint.new_by_array(point1_coordinates),
           GeometricPoint.new_by_array(point2_coordinates))
end

Public Instance Methods

contains?(point) click to toggle source
# File lib/flash_math/modules/geometry/geometric_bounding_box.rb, line 12
def contains?(point)
  point.x.between?(leftbottom.x, righttop.x) && point.y.between?(leftbottom.y, righttop.y)
end
diagonal() click to toggle source
# File lib/flash_math/modules/geometry/geometric_bounding_box.rb, line 8
def diagonal
  GeometricSegment.new(leftbottom, righttop)
end