Core 1.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
HemiSphere Class Reference

Hemispheres. More...

#include <hemisphere.h>

Public Member Functions

 HemiSphere (const Vector &, const Vector &, const double &)
 Create a hemi-sphere. More...
 
 HemiSphere (const double &)
 Create a hemi-sphere centered at the origin and with vertical direction. More...
 
 ~HemiSphere ()
 Empty.
 
Vector Normal (const Vector &) const
 Compute the distance vector between the hemisphere and a point. More...
 
double R (const Vector &) const
 Compute the distance between the hemisphere and a point. More...
 
double Signed (const Vector &) const
 Compute the Euclidean signed distance between the hemisphere and a point. More...
 
Box GetBox () const
 Compute the bouding box.
 
Vector Center () const
 Gets the center of a hemisphere.
 
double Radius () const
 Gets the radius of a hemisphere.
 
Vector GetAxis () const
 Gets the axis of the hemisphere.
 
Vector Fibonacci (int, int)
 Compute the i-th Fibonacci direction on the hemisphere. More...
 

Static Public Member Functions

static Vector FibonacciUnit (int, int)
 Compute the i-th Fibonacci direction on the vertical unit hemisphere. More...
 
static Vector RandomDirection (const Vector &, Random &=Random::R239)
 Generate a random direction. More...
 

Protected Attributes

Vector c = Vector::Null
 Center.
 
double r = 1.0
 Radius.
 
Vector axis = Vector::Z
 Axis.
 

Detailed Description

Hemispheres.

Constructor & Destructor Documentation

◆ HemiSphere() [1/2]

HemiSphere::HemiSphere ( const Vector c,
const Vector a,
const double &  r 
)
explicit

Create a hemi-sphere.

Parameters
cCenter.
rRadius.
aAxis, should be normalized.

◆ HemiSphere() [2/2]

HemiSphere::HemiSphere ( const double &  r)
explicit

Create a hemi-sphere centered at the origin and with vertical direction.

Parameters
rRadius.

Member Function Documentation

◆ Fibonacci()

Vector HemiSphere::Fibonacci ( int  i,
int  n 
)

Compute the i-th Fibonacci direction on the hemisphere.

Parameters
iPoint index.
nNumber of samples on the hemisphere.

◆ FibonacciUnit()

Vector HemiSphere::FibonacciUnit ( int  i,
int  n 
)
static

Compute the i-th Fibonacci direction on the vertical unit hemisphere.

Parameters
iPoint index.
nNumber of samples on the hemisphere.

◆ Normal()

Vector HemiSphere::Normal ( const Vector p) const

Compute the distance vector between the hemisphere and a point.

Parameters
pPoint.

◆ R()

double HemiSphere::R ( const Vector p) const

Compute the distance between the hemisphere and a point.

Parameters
pPoint.

◆ RandomDirection()

Vector HemiSphere::RandomDirection ( const Vector axis,
Random random = Random::R239 
)
static

Generate a random direction.

Parameters
axisAxis.
randomRandom number generator.

◆ Signed()

double HemiSphere::Signed ( const Vector p) const

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

Parameters
pPoint.