Core 1.0
|
An annulus, the region between two concentric circles. More...
#include <annulus.h>
Public Member Functions | |
Annulus2 () | |
Empty. | |
Annulus2 (const double &, const double &) | |
Creates a annulus. | |
Annulus2 (const Vector2 &, const double &, const double &) | |
Creates a annulus. | |
Annulus2 (const Circle2 &, const double &) | |
Creates a annulus. | |
~Annulus2 () | |
Empty. | |
Box2 | GetBox () const |
Bounding box. | |
Vector2 | RandomInside (Random &=Random::R239) const |
Generate a random vector inside the region between the two concentric circles. | |
double | Area () const |
Area. | |
double | R (const Vector2 &) const |
Compute the squared distance to a point. | |
double | Signed (const Vector2 &) const |
Compute the squared distance to a point. | |
Vector2 | Normal (const Vector2 &) const |
Computes the distance vector between a hexagon and a point. | |
int | Intersect (const Ray2 &, double *) const |
Compute the intersection with a ray. | |
bool | Inside (const Vector2 &) const |
Check if a point is inside. | |
void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
Draw the shape. | |
Protected Attributes | |
Vector2 | c = Vector2::Null |
Center of the circle. | |
double | re = 1.0 |
Interior and exterior radii. | |
Static Protected Attributes | |
static constexpr const double | Epsilon = 1.e-6 |
Epslion for intersection tests | |
An annulus, the region between two concentric circles.
|
explicit |
Creates a annulus.
re,ri | Exterior and interior Radii. |
|
explicit |
Creates a annulus.
c | Center. |
re,ri | Exterior and interior radii, exterior should be greater. |
|
explicit |
Creates a annulus.
c | Circle, its radius should be greater than the interior radius. |
ri | Interior Radius. |
void Annulus2::Draw | ( | QGraphicsScene & | scene, |
const QPen & | pen = QPen(), | ||
const QBrush & | brush = QBrush() ) const |
Draw the shape.
scene | Graphics scene. |
pen | The pen. |
brush | The brush. |
bool Annulus2::Inside | ( | const Vector2 & | p | ) | const |
Check if a point is inside.
p | Point. |
int Annulus2::Intersect | ( | const Ray2 & | ray, |
double * | t ) const |
Compute the intersection with a ray.
ray | The ray. |
t | Set of intersections. |
Computes the distance vector between a hexagon and a point.
p | Point. |
double Annulus2::R | ( | const Vector2 & | p | ) | const |
Compute the squared distance to a point.
p | Point. |
Vector2 Annulus2::RandomInside | ( | Random & | random = Random::R239 | ) | const |
Generate a random vector inside the region between the two concentric circles.
random | Random number generator. |
double Annulus2::Signed | ( | const Vector2 & | p | ) | const |
Compute the squared distance to a point.
p | Point. |