Octogons in the plane.
More...
#include <octogon.h>
|
| Octogon2 () |
| Empty.
|
|
| Octogon2 (const Vector2 &, const double &) |
| Create an octogon. More...
|
|
| Octogon2 (const double &) |
| Create an octogon. More...
|
|
void | Translate (const Vector2 &) |
| Translate an octogon. More...
|
|
void | Scale (const double &) |
| Scale an octogon. More...
|
|
bool | Inside (const Vector2 &) const |
| Test if a point is inside. More...
|
|
double | R (const Vector2 &) const |
| Compute the squared Euclidean distance to the octogon. More...
|
|
double | Signed (const Vector2 &) const |
| Compute the signed Euclidean distance to the octogon. More...
|
|
Vector2 | Normal (const Vector2 &) const |
| Computes the distance vector between an octogon and a point. More...
|
|
Vector2 | Center () const |
| Return the center of the octogon.
|
|
double | Radius () const |
| Return the radius of the octogon.
|
|
double | InscribedRadius () const |
| Inscribed radius.
|
|
Vector2 | Radial (int) const |
| Return the radial vector of the k-th vertex. More...
|
|
Vector2 | Edge (int) const |
| Return the edge vector connecting vertexes k and k+1. More...
|
|
Vector2 | Vertex (int) const |
| Return the coordinates of the k-th vertex. More...
|
|
Box2 | GetBox () const |
| Computes the bounding box of an octogon.
|
|
double | Area () const |
| Area of the octogon.
|
|
double | Perimeter () const |
| Perimeter of the octogon.
|
|
double | Edge () const |
| Edge length.
|
|
void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draws an octogon. More...
|
|
|
static const Vector2 | vertex [8] |
| Array of vertices.
|
|
static const Vector2 | normal [8] |
| Array of normal vectors to the edges.
|
|
static const Vector2 | edge [8] |
| Unit edge vectors.
|
|
◆ Octogon2() [1/2]
Octogon2::Octogon2 |
( |
const Vector2 & |
c, |
|
|
const double & |
r |
|
) |
| |
|
explicit |
Create an octogon.
- Parameters
-
◆ Octogon2() [2/2]
Octogon2::Octogon2 |
( |
const double & |
r | ) |
|
|
explicit |
Create an octogon.
- Parameters
-
◆ Draw()
void Octogon2::Draw |
( |
QGraphicsScene & |
scene, |
|
|
const QPen & |
pen = QPen() , |
|
|
const QBrush & |
brush = QBrush() |
|
) |
| const |
Draws an octogon.
- Parameters
-
scene | Graphics scene. |
pen | The pen. |
brush | The brush. |
◆ Edge()
Vector2 Octogon2::Edge |
( |
int |
k | ) |
const |
|
inline |
Return the edge vector connecting vertexes k and k+1.
- Parameters
-
k | Index, should be in [0,7]. |
◆ Inside()
bool Octogon2::Inside |
( |
const Vector2 & |
p | ) |
const |
Test if a point is inside.
- Parameters
-
◆ Normal()
Computes the distance vector between an octogon and a point.
- Parameters
-
◆ R()
double Octogon2::R |
( |
const Vector2 & |
p | ) |
const |
Compute the squared Euclidean distance to the octogon.
- Parameters
-
◆ Radial()
Vector2 Octogon2::Radial |
( |
int |
k | ) |
const |
|
inline |
Return the radial vector of the k-th vertex.
- Parameters
-
k | Index, should be in [0,7]. |
◆ Scale()
void Octogon2::Scale |
( |
const double & |
s | ) |
|
Scale an octogon.
- Parameters
-
◆ Signed()
double Octogon2::Signed |
( |
const Vector2 & |
p | ) |
const |
Compute the signed Euclidean distance to the octogon.
- Parameters
-
◆ Translate()
void Octogon2::Translate |
( |
const Vector2 & |
t | ) |
|
Translate an octogon.
- Parameters
-
◆ Vertex()
Vector2 Octogon2::Vertex |
( |
int |
k | ) |
const |
|
inline |
Return the coordinates of the k-th vertex.
- Parameters
-
k | Index, should be in [0,7]. |
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
s, |
|
|
const Octogon2 & |
octogon |
|
) |
| |
|
friend |
Overloaded.
- Parameters
-
s | Stream. |
octogon | The octogon. |