Contains the description of a polygon, now with mutable. The traverse is stored.
More...
#include <polygon.h>
Contains the description of a polygon, now with mutable. The traverse is stored.
Definition at line 76 of file polygon.h.
◆ Polygon()
Polygon::Polygon |
( |
int |
n | ) |
|
Constructs a regular polygon with vertices on the unit circle.
- Parameters
-
[in] | n | number of vertices in the polygon |
- Warning
- We use a mutable member
_peri
which should be defined -1 whenever the class instance has been changed.
Definition at line 42 of file polygon.cpp.
◆ append()
void Polygon::append |
( |
const Point2D & |
a | ) |
|
|
inline |
Adds a vertex to the end of the polygon traverse.
- Parameters
-
Definition at line 90 of file polygon.h.
◆ number()
int Polygon::number |
( |
| ) |
const |
|
inline |
Number of vertices in polygon.
- Returns
- Number of vertices of the open polygon
Definition at line 96 of file polygon.h.
◆ operator<()
bool Polygon::operator< |
( |
const Polygon & |
rhs | ) |
const |
|
inline |
Less operator regarding the perimeter.
- Parameters
-
- Returns
- True iff perimeter of recent instance is less than the perimeter of the second instance.
Definition at line 110 of file polygon.h.
◆ perimeter()
float Polygon::perimeter |
( |
| ) |
const |
Computes the perimeter of the closed polygon.
- Returns
- Perimeter of the closed polygon
- Warning
- Uses a mutable variable
Definition at line 53 of file polygon.cpp.
The documentation for this class was generated from the following files: