Core 1.0
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Annulus2 Class Reference

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. More...
 
 Annulus2 (const Vector2 &, const double &, const double &)
 Creates a annulus. More...
 
 Annulus2 (const Circle2 &, const double &)
 Creates a annulus. More...
 
 ~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. More...
 
double Area () const
 Area.
 
double R (const Vector2 &) const
 Compute the squared distance to a point. More...
 
double Signed (const Vector2 &) const
 Compute the squared distance to a point. More...
 
Vector2 Normal (const Vector2 &) const
 Computes the distance vector between a hexagon and a point. More...
 
int Intersect (const Ray2 &, double *) const
 Compute the intersection with a ray. More...
 
bool Inside (const Vector2 &) const
 Check if a point is inside. More...
 

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
 

Detailed Description

An annulus, the region between two concentric circles.

Constructor & Destructor Documentation

◆ Annulus2() [1/3]

Annulus2::Annulus2 ( const double &  re,
const double &  ri 
)
explicit

Creates a annulus.

Parameters
re,riExterior and interior Radii.

◆ Annulus2() [2/3]

Annulus2::Annulus2 ( const Vector2 c,
const double &  re,
const double &  ri 
)
explicit

Creates a annulus.

Parameters
cCenter.
re,riExterior and interior radii, exterior should be greater.

◆ Annulus2() [3/3]

Annulus2::Annulus2 ( const Circle2 c,
const double &  ri 
)
explicit

Creates a annulus.

Parameters
cCircle, its radius should be greater than the interior radius.
riInterior Radius.

Member Function Documentation

◆ Inside()

bool Annulus2::Inside ( const Vector2 p) const

Check if a point is inside.

Parameters
pPoint.

◆ Intersect()

int Annulus2::Intersect ( const Ray2 ray,
double *  t 
) const

Compute the intersection with a ray.

Parameters
rayThe ray.
tSet of intersections.

◆ Normal()

Vector2 Annulus2::Normal ( const Vector2 p) const

Computes the distance vector between a hexagon and a point.

Parameters
pPoint.

◆ R()

double Annulus2::R ( const Vector2 p) const

Compute the squared distance to a point.

Parameters
pPoint.

◆ RandomInside()

Vector2 Annulus2::RandomInside ( Random random = Random::R239) const

Generate a random vector inside the region between the two concentric circles.

Parameters
randomRandom number generator.

◆ Signed()

double Annulus2::Signed ( const Vector2 p) const

Compute the squared distance to a point.

Parameters
pPoint.