## CGAL::Iso_rectangle_2<Kernel>

### Definition

An object s of the data type Iso_rectangle_2<Kernel> is a rectangle in the Euclidean plane 2 with sides parallel to the x and y axis of the coordinate system.

Although they are represented in a canonical form by only two vertices, namely the lower left and the upper right vertex, we provide functions for ``accessing'' the other vertices as well. The vertices are returned in counterclockwise order.

Iso-oriented rectangles and bounding boxes are quite similar. The difference however is that bounding boxes have always double coordinates, whereas the coordinate type of an iso-oriented rectangle is chosen by the user.

### Creation

Iso_rectangle_2<Kernel> r ( Point_2<Kernel> p, Point_2<Kernel> q);
introduces an iso-oriented rectangle r with diagonal opposite vertices p and q. Note that the object is brought in the canonical form.

Iso_rectangle_2<Kernel> r ( Point_2<Kernel> p, Point_2<Kernel> q, int);
introduces an iso-oriented rectangle r with diagonal opposite vertices p and q. The int argument value is only used to distinguish the two overloaded functions.
 Precondition: p.x()<=q.x() and p.y()<=q.y().

Iso_rectangle_2<Kernel> r ( Point_2<Kernel> left, Point_2<Kernel> right, Point_2<Kernel> bottom, Point_2<Kernel> top);
introduces an iso-oriented rectangle r whose minimal x coordinate is the one of left, the maximal x coordinate is the one of right, the minimal y coordinate is the one of bottom, the maximal y coordinate is the one of top.

Iso_rectangle_2<Kernel> r ( Kernel::RT min_hx, Kernel::RT min_hy, Kernel::RT max_hx, Kernel::RT max_hy, Kernel::RT hw = RT(1));
introduces an iso-oriented rectangle r with diagonal opposite vertices (min_hx/hw, min_hy/hw) and (max_hx/hw, max_hy/hw).
 Precondition: hw 0.

### Operations

bool r.operator== ( r2) Test for equality: two iso-oriented rectangles are equal, iff their lower left and their upper right vertices are equal.

bool r.operator!= ( r2) Test for inequality.

Point_2<Kernel> r.vertex ( int i) returns the i'th vertex modulo 4 of r in counterclockwise order, starting with the lower left vertex.

Point_2<Kernel> r.operator[] ( int i) returns vertex(i).

Point_2<Kernel> r.min () returns the lower left vertex of r (= vertex(0)).

Point_2<Kernel> r.max () returns the upper right vertex of r (= vertex(2)).

Kernel::FT r.xmin () returns the x coordinate of lower left vertex of r.
Kernel::FT r.ymin () returns the y coordinate of lower left vertex of r.
Kernel::FT r.xmax () returns the x coordinate of upper right vertex of r.
Kernel::FT r.ymax () returns the y coordinate of upper right vertex of r.

Kernel::FT r.min_coord ( int i) returns the i'th Cartesian coordinate of the lower left vertex of r.
 Precondition: 0 i 1.

Kernel::FT r.max_coord ( int i) returns the i'th Cartesian coordinate of the upper right vertex of r.
 Precondition: 0 i 1.

### Predicates

 bool r.is_degenerate () r is degenerate, if all vertices are collinear. Bounded_side r.bounded_side ( Point_2 p) returns either ON_UNBOUNDED_SIDE, ON_BOUNDED_SIDE, or the constant ON_BOUNDARY, depending on where point p is. bool r.has_on_boundary ( Point_2 p) bool r.has_on_bounded_side ( Point_2 p) bool r.has_on_unbounded_side ( Point_2 p)

### Miscellaneous

Kernel::FT r.area () returns the area of r.

Bbox r.bbox () returns a bounding box containing r.

Iso_rectangle_2<Kernel> r.transform ( Aff_transformation_2<Kernel> t)
returns the iso-oriented rectangle obtained by applying t on the lower left and the upper right corner of r.
 Precondition: The angle at a rotation must be a multiple of /2, otherwise the resulting rectangle does not have the same side length. Note that rotating about an arbitrary angle can even result in a degenerate iso-oriented rectangle.
{"ft_lang_label":"__label__en","ft_lang_prob":0.72783583,"math_prob":0.97080123,"size":2231,"snap":"2020-45-2020-50","text_gpt3_token_len":531,"char_repetition_ratio":0.19802424,"word_repetition_ratio":0.2958115,"special_character_ratio":0.2415957,"punctuation_ratio":0.10824742,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9989823,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-28T05:02:43Z\",\"WARC-Record-ID\":\"<urn:uuid:69682639-b7de-4dea-aa22-ad7fc5090b17>\",\"Content-Length\":\"20733\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e4f688af-0e8c-4f30-a3c6-dff0e0d578ce>\",\"WARC-Concurrent-To\":\"<urn:uuid:3bab8413-c0d8-4d1b-8eb2-4221648fea7d>\",\"WARC-IP-Address\":\"213.186.33.40\",\"WARC-Target-URI\":\"https://doc.cgal.org/Manual/3.3/doc_html/cgal_manual/Kernel_23_ref/Class_Iso_rectangle_2.html\",\"WARC-Payload-Digest\":\"sha1:MYYUTMNKZ554QJ7ZJDJLSECX55UVPKVE\",\"WARC-Block-Digest\":\"sha1:7BKA237L5BSAH5SVEPM5FUQ3L66NWY6F\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141195069.35_warc_CC-MAIN-20201128040731-20201128070731-00346.warc.gz\"}"}