Core 1.0
|
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. | |
Lenses with uniform radius.
A lens is defined as the intersection of two spheres with the same radius.
Create a lens.
a,b | Centers of the circles. |
r | Radius. |
|
explicit |
Create a lens.
c | Centers of the lens. |
t | Thickness. |
h | Height. |
bool Lens::Inside | ( | const Vector & | p | ) | const |
Test if a point is inside the lens.
p | Point. |
double Lens::R | ( | const Vector & | p | ) | const |
Compute the squared Euclidean distance to the lens.
p | Point. |
void Lens::Rotate | ( | const Matrix & | r | ) |
Rotates a lens.
r | Rotation matrix. |
void Lens::Scale | ( | const double & | s | ) |
Scale a lens.
s | Scaling factor. |
double Lens::Signed | ( | const Vector & | p | ) | const |
Compute the Euclidean distance to the lens.
p | Point. |
void Lens::Translate | ( | const Vector & | t | ) |
Translate a lens.
t | Translation vector. |
|
friend |
Overloaded.
s | Stream. |
l | Lens. |