1 USING: help.markup help.syntax kernel ;
5 { $class-description "A rectangle with the following slots:"
7 { { $slot "loc" } " - the top-left corner of the rectangle as an x/y pair" }
8 { { $slot "dim" } " - the dimensions of the rectangle as a width/height pair" }
10 "Rectangles are constructed by calling " { $link <rect> } " and " { $link <extent-rect> } "."
14 { $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } { "rect" "a new " { $link rect } } }
15 { $description "Creates a new rectangle with the specified top-left location and dimensions." } ;
17 { <zero-rect> <rect> <extent-rect> } related-words
20 { $values { "rect" rect } { "loc" "a pair of integers" } { "dim" "a pair of integers" } }
21 { $description "Outputs the location and dimensions of a rectangle." } ;
23 { rect-bounds rect-extent } related-words
26 { $values { "loc" "a pair of integers" } { "ext" "a pair of integers" } { "rect" "a new " { $link rect } } }
27 { $description "Creates a new rectangle with the specified top-left and bottom-right corner locations." } ;
30 { $values { "rect" rect } { "loc" "a pair of integers" } { "ext" "a pair of integers" } }
31 { $description "Outputs the location of the top-left and bottom-right corners of a rectangle." } ;
34 { $values { "rect" rect } { "loc" "a pair of integers" } { "newrect" "a new " { $link rect } } }
35 { $description "Creates a new rectangle with the same dimensions, and top-left corner translated by " { $snippet "loc" } "." } ;
38 { $values { "rect1" rect } { "rect2" rect } { "newrect" "a new " { $link rect } } }
39 { $description "Computes the intersection of two rectangles." } ;
42 { $values { "rect1" rect } { "rect2" rect } { "?" boolean } }
43 { $description "Tests if two rectangles have a non-empty intersection." } ;
46 { $values { "point" "a pair of integers" } { "rect" rect } { "?" boolean } }
47 { $description "Tests if a rectangle contains a point." } ;
50 { $values { "rect" "a new " { $link rect } } }
51 { $description "Creates a rectangle located at the origin with zero dimensions." } ;
53 ARTICLE: "math.rectangles" "Rectangles"
54 "The " { $vocab-link "math.rectangles" } " vocabulary defines a rectangle data type and operations on them."
56 "Rectangles can be taken apart:"
61 "New rectangles can be created:"
67 "Set-theoretic operations on rectangles:"
75 { $subsections offset-rect } ;
77 ABOUT: "math.rectangles"