|
Thunderbots Project
|
#include <rectangle.h>


Public Member Functions | |
| Rectangle (const Point &point1, const Point &point2) | |
| double | xLength () const |
| double | yLength () const |
| Point | centre () const |
| const Point & | posXPosYCorner () const |
| const Point & | negXPosYCorner () const |
| const Point & | negXNegYCorner () const |
| const Point & | posXNegYCorner () const |
| double | xMax () const |
| double | xMin () const |
| double | yMax () const |
| double | yMin () const |
| Vector | diagonal () const |
| double | halfPerimeter () const |
| Rectangle | expand (double expansion_amount) const |
| bool | operator== (const Rectangle &p) const |
Public Member Functions inherited from ConvexPolygon | |
| double | area () const override |
| ConvexPolygon (const std::vector< Point > &points) | |
| ConvexPolygon (const std::initializer_list< Point > &points) | |
Public Member Functions inherited from Polygon | |
| Polygon (const std::vector< Point > &points) | |
| Polygon (const std::initializer_list< Point > &points) | |
| Point | centroid () const |
| Polygon | expand (double expansion_amount) const |
| double | perimeter () const |
| const std::vector< Segment > & | getSegments () const |
| const std::vector< Point > & | getPoints () const |
Additional Inherited Members | |
Static Public Member Functions inherited from Polygon | |
| static Polygon | fromSegment (const Segment &segment, double length_radius, double width_radius) |
| static Polygon | fromSegment (const Segment &segment, double radius) |
Protected Member Functions inherited from Polygon | |
| void | initSegments () |
Protected Attributes inherited from Polygon | |
| std::vector< Point > | points_ |
| std::vector< Segment > | segments_ |
A rectangle is a ConvexPolygon of four Points with the invariant that two sides are parallel to the x axis and two sides are parallel to the y axis
Creates a new Rectangle from two corners.
-----—p1/2 p1/2-----— | | | | p1/2------—* or *-----—p1/2
| point1 | One of the rectangle's corners |
| point2 | The corner diagonally-opposite to point1 |
| Point centre | ( | ) | const |
Returns the centre of the rectangle
| Vector diagonal | ( | ) | const |
Returns a vector from negXNegY point of the rectangle to the posXPosY point
| Rectangle expand | ( | double | expansion_amount | ) | const |
| double halfPerimeter | ( | ) | const |
The half perimeter of the rectangle
| const Point & negXNegYCorner | ( | ) | const |
Returns the <-x,-y> corner of the rectangle
| const Point & negXPosYCorner | ( | ) | const |
Returns the <-x,+y> corner of the rectangle
| const Point & posXNegYCorner | ( | ) | const |
Returns the <+x,-y> corner of the rectangle
| const Point & posXPosYCorner | ( | ) | const |
Returns the <+x,+y> corner of the rectangle
| double xLength | ( | ) | const |
Returns the length along the x-axis of the rectangle
| double xMax | ( | ) | const |
Gets the maximum x value of the rectangle
return max x value
| double xMin | ( | ) | const |
Gets the minimum x value of the rectangle
return min x value
| double yLength | ( | ) | const |
Returns the length along the y-axis of the rectangle
| double yMax | ( | ) | const |
Gets the maximum y value of the rectangle
return max y value
| double yMin | ( | ) | const |
Gets the minimum y value of the rectangle
return min y value