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

Symmetric ellipsoids, i.e., ellipsoids with the same radial coefficients. More...

#include <ellipse.h>

Public Member Functions

 Ellipsoid ()
 Empty.
 
 Ellipsoid (const Vector &, const Vector &, const double &, const double &)
 Create an ellipsoid. More...
 
 Ellipsoid (const Vector &, const Vector &, const double &)
 Create an ellipsoid. More...
 
 ~Ellipsoid ()
 Empty.
 
Vector Center () const
 Gets the center.
 
Vector GetAxis () const
 Gets the center.
 
double A () const
 Major radius of the ellipse.
 
double B () const
 Minor radius of the ellipse.
 
Box GetBox () const
 Compute the bouding box.
 
Ellipsoid Rotated (const Matrix &) const
 Rotates an ellipsoid. More...
 
Ellipsoid Translated (const Vector &) const
 Translates an ellipsoid. More...
 
double R (const Vector &) const
 Compute the squared distance between a point and the ellipse. More...
 
double Volume () const
 Compute the volume of an ellipsoid.
 

Protected Member Functions

double Value (const Vector &) const
 Compute the field function value of an ellipsoid. More...
 

Protected Attributes

Vector c = Vector::Null
 Center of the ellipsoid.
 
Vector axis = Vector::Z
 Axis.
 
double b = 1.0
 Axis length, and radial length (revolution).
 

Detailed Description

Symmetric ellipsoids, i.e., ellipsoids with the same radial coefficients.

Symmetric ellipsoids are surfaces of revolution, thus the Euclidean distance of a point or the signed distance can be computed analytically.

See also
Ellipse2

Constructor & Destructor Documentation

◆ Ellipsoid() [1/2]

Ellipsoid::Ellipsoid ( const Vector c,
const Vector axis,
const double &  a,
const double &  b 
)
explicit

Create an ellipsoid.

Parameters
cCenter.
axisAxis (should be normalized).
a,bAxis length and radial length.

◆ Ellipsoid() [2/2]

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

Create an ellipsoid.

Parameters
cCenter.
axisAxis of revolution, whose norm will define the first radius.
rRadial length.

Member Function Documentation

◆ R()

double Ellipsoid::R ( const Vector p) const

Compute the squared distance between a point and the ellipse.

It is possible to compute the closed form expression of the distance to an ellipsoid whenever the ellipsoid is symmetrical in one axis in which case the ellipsoid is a surface of revolution, and the distance boils down to evaluating the distance between a point and an ellipse.

Parameters
pPoint.
See also
Ellipse2::R(const Vector2&)

◆ Rotated()

Ellipsoid Ellipsoid::Rotated ( const Matrix r) const

Rotates an ellipsoid.

Parameters
rRotation matrix.

◆ Translated()

Ellipsoid Ellipsoid::Translated ( const Vector t) const

Translates an ellipsoid.

Parameters
tTranslation vector.

◆ Value()

double Ellipsoid::Value ( const Vector p) const
protected

Compute the field function value of an ellipsoid.

Parameters
pPoint.