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

Quadric surfaces. More...

#include <quadricsurface.h>

Public Member Functions

 QuadricSurface (const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &)
 Create a quadric surface. More...
 
 QuadricSurface (const Matrix &, const double &=1.0)
 Create a quadric surface from elevations. More...
 
double Value (const Vector2 &) const
 Compute the value. More...
 
Vector2 Gradient (const Vector2 &) const
 Compute gradient. More...
 
Vector2 Normal (const Vector2 &) const
 Compute normal. More...
 
QuadricSurface operator/ (double) const
 Overloaded operator. More...
 
QuadricSurface operator* (double) const
 Overloaded operator. More...
 
QuadricSurface operator+ (const QuadricSurface &) const
 Overloaded operator. More...
 
QuadricSurface operator- (const QuadricSurface &) const
 Overloaded operator. More...
 
QuadricSurface Translated (const Vector2 &) const
 Translate a quadric surface. More...
 
QuadricSurface Scaled (const double &) const
 Scale a quadric surface. More...
 
double operator() (int, int) const
 Return the coefficient. More...
 
double & operator() (int, int)
 Return the coefficient. More...
 

Protected Member Functions

constexpr const int Index (int, int) const
 Return the index of the coefficient xa yb
 

Protected Attributes

double c [9] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
 Quadric coefficients.
 

Detailed Description

Quadric surfaces.

Constructor & Destructor Documentation

◆ QuadricSurface() [1/2]

QuadricSurface::QuadricSurface ( const double &  a22,
const double &  a21,
const double &  a12,
const double &  a20,
const double &  a02,
const double &  a11,
const double &  a10,
const double &  a01,
const double &  a00 
)
explicit

Create a quadric surface.

z=a22 x2y2 + a21 x2y + a21 xy2 + a20 x2 + a02 y2 + a11 xy + a10 x + a01 y + a00.

◆ QuadricSurface() [2/2]

QuadricSurface::QuadricSurface ( const Matrix m,
const double &  e = 1.0 
)
explicit

Create a quadric surface from elevations.

Parameters
zMatrix of elevations.
eDistance.

Member Function Documentation

◆ Gradient()

Vector2 QuadricSurface::Gradient ( const Vector2 p) const

Compute gradient.

Parameters
pPoint.

◆ Normal()

Vector2 QuadricSurface::Normal ( const Vector2 p) const

Compute normal.

Parameters
pPoint.

◆ operator()() [1/2]

double & QuadricSurface::operator() ( int  i,
int  j 
)
inline

Return the coefficient.

Parameters
i,jCoefficient indexes.

◆ operator()() [2/2]

double QuadricSurface::operator() ( int  i,
int  j 
) const
inline

Return the coefficient.

Parameters
i,jCoefficient indexes.

◆ operator*()

QuadricSurface QuadricSurface::operator* ( double  a) const
inline

Overloaded operator.

Parameters
aReal.

◆ operator+()

QuadricSurface QuadricSurface::operator+ ( const QuadricSurface q) const
inline

Overloaded operator.

Parameters
qQuadric surface.

◆ operator-()

QuadricSurface QuadricSurface::operator- ( const QuadricSurface q) const
inline

Overloaded operator.

Parameters
qQuadric surface.

◆ operator/()

QuadricSurface QuadricSurface::operator/ ( double  a) const
inline

Overloaded operator.

Parameters
aReal.

◆ Scaled()

QuadricSurface QuadricSurface::Scaled ( const double &  s) const

Scale a quadric surface.

Parameters
sScaling coefficient.

◆ Translated()

QuadricSurface QuadricSurface::Translated ( const Vector2 t) const

Translate a quadric surface.

Parameters
tTranslation vector.

◆ Value()

double QuadricSurface::Value ( const Vector2 p) const
inline

Compute the value.

Parameters
pPoint.