|
Core 1.0
|
Rectangles. More...
#include <rectangle.h>
Public Member Functions | |
| Rectangles () | |
| Empty. | |
| Rectangles (const double &, const double &) | |
| Create a horizontal rectangle in the xy-plane, centered at the origin. | |
| Rectangles (const Vector &, const Vector &, const Vector &) | |
| Create a rectangle given its center and two orthogonal axes. | |
| Rectangles (const Vector &, const Vector &, const Vector &, const double &, const double &) | |
| Create a rectangle given its center and two orthogonal axes. | |
| ~Rectangles () | |
| Empty. | |
| Vector | Center () const |
| Gets the center of the rectangle. | |
| Vector | Vertex (const double &, const double &) const |
| Compute the coordinates of a vertex in the rectangle. | |
| Vector | Normal () const |
| Return the normal. | |
| double | R (const Vector &) const |
| Compute the squared distance between a point and the rectangle. | |
| Vector | Normal (const Vector &) const |
| Computes the vector distance between the box and a point. | |
| void | Rotate (const Matrix &) |
| Rotate the rectangle. | |
| void | Translate (const Vector &) |
| Translate the rectangle. | |
| void | Scale (const double &) |
| Scale the rectangle. | |
| Box | GetBox () const |
| Compute the box embedding the shape. | |
| double | Area () const |
| Compute the area of the rectangle. | |
| double | Width () const |
| Return the half width. | |
| double | Height () const |
| Return the half height. | |
Protected Attributes | |
| Vector | z = Vector::Z |
| Axes. | |
| Vector | c = Vector::Null |
| Center. | |
| double | b = 1.0 |
| Side lengths. | |
Static Protected Attributes | |
| static double | epsilon = 1.0e-10 |
| Internal epsilon constant. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Rectangles &rectangle) |
| Overloaded. | |
Rectangles.
|
explicit |
Create a horizontal rectangle in the xy-plane, centered at the origin.
| a,b | Size. |
Create a rectangle given its center and two orthogonal axes.
| c | Origin |
| x,y | Axes. |
|
explicit |
Create a rectangle given its center and two orthogonal axes.
| c | Origin |
| x,y | Unit axes (normalized). |
| a,b | Size. |
Computes the vector distance between the box and a point.
| p | Point. |
| double Rectangles::R | ( | const Vector & | p | ) | const |
Compute the squared distance between a point and the rectangle.
| p | Point. |
| void Rectangles::Rotate | ( | const Matrix & | r | ) |
Rotate the rectangle.
| r | Rotation matrix. |
| void Rectangles::Scale | ( | const double & | s | ) |
Scale the rectangle.
| s | Scaling factor. |
| void Rectangles::Translate | ( | const Vector & | t | ) |
Translate the rectangle.
| t | Translation vector. |
| Vector Rectangles::Vertex | ( | const double & | u, |
| const double & | v ) const |
Compute the coordinates of a vertex in the rectangle.
| u,v | Coordinates of the point. |
|
friend |
Overloaded.
| s | Stream. |
| rectangle | The rectangle. |