Core 1.0
|
A disc in three dimensions. More...
#include <circle.h>
Public Member Functions | |
Disc () | |
Empty. | |
Disc (const double &) | |
Creates a horizontal disc centered at origin. More... | |
Disc (const Vector &, const Vector &, const double &) | |
Creates a disc. More... | |
Disc (const Vector &, const Vector &, const Vector &) | |
Creates a disc given three vertices. More... | |
~Disc () | |
Empty. | |
double | R (const Vector &) const |
Computes the distance between a point and the disc. More... | |
Vector | Normal (const Vector &) const |
Computes the distance vector between a disc and a point. More... | |
Public Member Functions inherited from Circle | |
Circle () | |
Empty. | |
Circle (const double &) | |
Creates a circle. More... | |
Circle (const Vector &, const Vector &, const double &) | |
Creates a circle. More... | |
Circle (const Vector &, const Vector &, const Vector &) | |
Creates a circle given three vertices. More... | |
~Circle () | |
Empty. | |
bool | Intersect (const Ray &, double &) const |
Compute the ray-disc intersection. More... | |
Vector | Center () const |
Gets the center of a circle. | |
Vector | Axis () const |
Axis of the circle. | |
double | Radius () const |
Radius of the circle. | |
double | R (const Vector &) const |
Compute the distance between a point and a circle. More... | |
Vector | Normal (const Vector &) const |
Computes the distance vector between a circle and a point. More... | |
void | Rotate (const Matrix &) |
Rotates a circle. More... | |
void | Translate (const Vector &) |
Transltes a circle. More... | |
void | Scale (const double &) |
Uniformly scales a circle. More... | |
Box | GetBox () const |
Compute the axis aligned bounding box of a circle. More... | |
double | Area () const |
Area of a circle. More... | |
Vector | RandomInside (Random &=Random::R239) const |
Generate a random vector inside the circle. More... | |
Vector | RandomOn (Random &=Random::R239) const |
Generate a random vector on the circle. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Circle | |
static double | Area (const double &) |
Area of a circle given its radius. More... | |
Protected Attributes inherited from Circle | |
Vector | c = Vector::Null |
Center of the circle. | |
Vector | axis = Vector::Z |
Axis. | |
double | r = 1.0 |
Radius. | |
Static Protected Attributes inherited from Circle | |
static constexpr const double | epsilon = 1.0e-10 |
Internal epsilon constant. | |
A disc in three dimensions.
Discs derive from Circle, and only reimplement a few functions, such as Disc::R().
|
explicit |
Creates a horizontal disc centered at origin.
r | Radius. |
Creates a disc.
c | Center. |
axis | Axis, which should be normalized. |
r | Radius. |
Creates a disc given three vertices.
Basically set the center to the center of the triangle, and compute the radius.
x,y,z | Argument vertices |
Computes the distance vector between a disc and a point.
This function implicitly projects the point in the plane of the circle and computes the distance to the disc in its plane, before adding the extra term along the normal.
p | Point. |
double Disc::R | ( | const Vector & | p | ) | const |
Computes the distance between a point and the disc.
Cost: 10 +, 8 *, 1 sqrt()
p | Point. |