Open Sidebar
Close Sidebar
CrystalDoc.info
Source code
Shards.info
geometry
v0.2.0
Geometry
Line
Point
Rectangle
Built with Crystal 1.9.2
2023-10-08 14:52:21 UTC
struct
Geometry::Rectangle
Geometry::Rectangle
Struct
Value
Object
Defined in:
geometry/rectangle.cr
Constructors
.new
(top_left : Geometry::Point, bottom_right : Geometry::Point)
Instance Method Summary
#area
#bottom_right
: Point
#height
#intersects
(other : Rectangle) : Bool
#perimeter
#top_left
: Point
#width
Constructor Detail
def self.
new
(top_left :
Geometry::Point
, bottom_right :
Geometry::Point
)
#
[
View source
]
Instance Method Detail
def
area
#
[
View source
]
def
bottom_right
:
Point
#
[
View source
]
def
height
#
[
View source
]
def
intersects
(other :
Rectangle
) : Bool
#
[
View source
]
def
perimeter
#
[
View source
]
def
top_left
:
Point
#
[
View source
]
def
width
#
[
View source
]