Core 1.0
Lens Class Reference

Lenses with uniform radius. More...

#include <lens.h>

Public Member Functions

 Lens (const Vector &, const Vector &, const double &)
 Create a lens.
 
 Lens (const Vector &, const double &, const double &)
 Create a lens.
 
bool Inside (const Vector &) const
 Test if a point is inside the lens.
 
double R (const Vector &) const
 Compute the squared Euclidean distance to the lens.
 
double Signed (const Vector &) const
 Compute the Euclidean distance to the lens.
 
Vector Center () const
 Compute the center of the lens.
 
double Height () const
 Compute the height of the lens.
 
double Thickness () const
 Compute the thickness of the lens.
 
void Rotate (const Matrix &)
 Rotates a lens.
 
void Translate (const Vector &)
 Translate a lens.
 
void Scale (const double &)
 Scale a lens.
 
Box GetBox () const
 Compute the (tight) bounding box.
 

Protected Attributes

Vector b = -Vector::X
 Centers.
 
double r = 3.0
 Radius.
 

Friends

std::ostream & operator<< (std::ostream &s, const Lens &l)
 Overloaded.
 

Detailed Description

Lenses with uniform radius.

A lens is defined as the intersection of two spheres with the same radius.

Constructor & Destructor Documentation

◆ Lens() [1/2]

Lens::Lens ( const Vector & a,
const Vector & b,
const double & r )
explicit

Create a lens.

Parameters
a,bCenters of the circles.
rRadius.

◆ Lens() [2/2]

Lens::Lens ( const Vector & c,
const double & t,
const double & h )
explicit

Create a lens.

Parameters
cCenters of the lens.
tThickness.
hHeight.

Member Function Documentation

◆ Inside()

bool Lens::Inside ( const Vector & p) const

Test if a point is inside the lens.

Parameters
pPoint.

◆ R()

double Lens::R ( const Vector & p) const

Compute the squared Euclidean distance to the lens.

Parameters
pPoint.

◆ Rotate()

void Lens::Rotate ( const Matrix & r)

Rotates a lens.

Parameters
rRotation matrix.

◆ Scale()

void Lens::Scale ( const double & s)

Scale a lens.

Parameters
sScaling factor.

◆ Signed()

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

Compute the Euclidean distance to the lens.

Parameters
pPoint.

◆ Translate()

void Lens::Translate ( const Vector & t)

Translate a lens.

Parameters
tTranslation vector.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Lens & l )
friend

Overloaded.

Parameters
sStream.
lLens.