Core 1.0
Public Member Functions | List of all members
Disc Class Reference

A disc in three dimensions. More...

#include <circle.h>

Inheritance diagram for Disc:
Circle

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.
 

Detailed Description

A disc in three dimensions.

Discs derive from Circle, and only reimplement a few functions, such as Disc::R().

Constructor & Destructor Documentation

◆ Disc() [1/3]

Disc::Disc ( const double &  r)
explicit

Creates a horizontal disc centered at origin.

Parameters
rRadius.

◆ Disc() [2/3]

Disc::Disc ( const Vector c,
const Vector axis,
const double &  r 
)
explicit

Creates a disc.

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

◆ Disc() [3/3]

Disc::Disc ( const Vector x,
const Vector y,
const Vector z 
)
explicit

Creates a disc given three vertices.

Basically set the center to the center of the triangle, and compute the radius.

Parameters
x,y,zArgument vertices

Member Function Documentation

◆ Normal()

Vector Disc::Normal ( const Vector p) const

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.

Parameters
pPoint.

◆ R()

double Disc::R ( const Vector p) const

Computes the distance between a point and the disc.

Cost: 10 +, 8 *, 1 sqrt()

Parameters
pPoint.