Core 1.0
Sector Class Reference

Intersection between a cone and a sphere. More...

#include <sector.h>

Public Member Functions

 Sector ()
 Empty.
 
 Sector (const double &, const double &=Math::HalfPi)
 Creates a sector.
 
 Sector (const Vector &, const Vector &, const double &, const double &=Math::HalfPi)
 Creates a sector.
 
 ~Sector ()
 Empty.
 
double Signed (const Vector &) const
 Compute the signed Euclidean distance between a point and a sector.
 
void Rotate (const Matrix &)
 Rotates a sector.
 
void Translate (const Vector &)
 Translates a circle.
 
void Scale (const double &)
 Uniformly scales a circle.
 
Box GetBox () const
 Compute the axis aligned bounding box of a circle.
 

Protected Attributes

Vector c = Vector::Null
 Center of the sector.
 
Vector axis = Vector::Z
 Axis.
 
Vector2 s = Vector2(Math::Sqrt2, Math::Sqrt2)
 Sine and cosine of the sector angle.
 
double a = Math::Pi / 4.0
 Angle.
 
double r = 1.0
 Radius.
 

Friends

std::ostream & operator<< (std::ostream &s, const Sector &sector)
 Overloaded.
 

Detailed Description

Intersection between a cone and a sphere.

Constructor & Destructor Documentation

◆ Sector() [1/2]

Sector::Sector ( const double & r,
const double & a = Math::HalfPi )
explicit

Creates a sector.

Parameters
rRadius.
aAngle.

◆ Sector() [2/2]

Sector::Sector ( const Vector & c,
const Vector & axis,
const double & r,
const double & a = Math::HalfPi )
explicit

Creates a sector.

Parameters
cCenter.
axisAxis, which should be normalized.
rRadius.
aAngle.

Member Function Documentation

◆ Rotate()

void Sector::Rotate ( const Matrix & r)

Rotates a sector.

Parameters
rRotation matrix.

◆ Scale()

void Sector::Scale ( const double & s)

Uniformly scales a circle.

Parameters
sScaling factor.

◆ Signed()

double Sector::Signed ( const Vector & p) const

Compute the signed Euclidean distance between a point and a sector.

Parameters
pPoint.

◆ Translate()

void Sector::Translate ( const Vector & t)

Translates a circle.

Parameters
tTranslation vector.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Sector & sector )
friend

Overloaded.

Parameters
sStream.
sectorThe sector.