geirs2Panic
Richard J. Mathar
Fits header keyword batch editor
|
A square represented by the four vertices of the corners. More...
#include <Square2D.h>
Public Member Functions | |
Square2D (const Point2D &pt1, const Point2D &pt2) | |
Create a planar square given the first two adjacent vertices. More... | |
Square2D (const Point2D &pt1, const Point2D &pt2, const Point2D &pt3, const Point2D &pt4) | |
Create a planar square given all four vertices. More... | |
Square2D () | |
operator Bbox2D () const | |
Generate the bounding box of this square. More... | |
Line2D | edge (int no) const |
Circle2D | circumC () const |
double | area () const |
Tria2D * | dissect () const |
Square2D | apply (const RotTrans2D &rt) const |
Compute the square that is rotated-translated. More... | |
vector< Tria2D > | intersect (const Square2D &oth) const |
Compute the common area (intersection) between this and another square. More... | |
Public Attributes | |
Point2D | vert [4] |
The points at the vertices. More... | |
double | eLen |
Edge length. More... | |
A square represented by the four vertices of the corners.
Create a planar square given the first two adjacent vertices.
The third and fourth vertex are defined by orthogonal extension off the baseline between the first and second vertex.
pt1 | The first vertex. |
pt2 | The second vertex. |
Square2D::Square2D | ( | const Point2D & | pt1, |
const Point2D & | pt2, | ||
const Point2D & | pt3, | ||
const Point2D & | pt4 | ||
) |
Create a planar square given all four vertices.
The four vertices are supposed to be given in ccs order. No checking on the length and mutual orthogonality of the edges is done!
pt1 | The first vertex. |
pt2 | The second vertex. |
pt3 | The third vertex. |
pt4 | The fourth vertex. |
Square2D::Square2D | ( | ) |
Create an empty square with four vertices all at the origin.
Square2D::operator Bbox2D | ( | ) | const |
Generate the bounding box of this square.
Line2D Square2D::edge | ( | int | no | ) | const |
Create a line that connects vertex number 'no' with the next vertex along the edge.
no | The edge number in the range 0 to 3. |
Circle2D Square2D::circumC | ( | ) | const |
Compute the circumcircle.
double Square2D::area | ( | ) | const |
Compute the area.
Tria2D * Square2D::dissect | ( | ) | const |
Dissect the square into two triangles along a diagonal.
Square2D Square2D::apply | ( | const RotTrans2D & | rt | ) | const |
Compute the square that is rotated-translated.
[in] | rt | The rotation-translation to be applied |
Compute the common area (intersection) between this and another square.
Point2D Square2D::vert[4] |
The points at the vertices.
double Square2D::eLen |
Edge length.