mt
 All Classes Files Functions Enumerations Groups Pages
Public Member Functions | List of all members
mt::Ellipse3 Class Reference

Three-dimensional ellipse class. More...

#include <ellipse3.h>

Public Member Functions

 Ellipse3 ()
 Default constructor. Creates a unit circle in the xy plane.
 Ellipse3 (const Point3 &center, const Vector3 &axis1, const Vector3 &axis2)
 Ellipse3 (const Plane3 &plane, const Cylinder3 &cylinder)
bool operator== (const Ellipse3 &e) const
bool operator!= (const Ellipse3 &e) const
Point3 project (const Point3 &p) const
Scalar distance (const Point3 &p) const
 Unsigned distance from point p to current ellipse.
Point3 getCenter () const
Point3getCenterRef ()
const Point3getCenterRef () const
Unit3getAxisDirRef (const size_t i=1)
const Unit3getAxisDirRef (const size_t i=1) const
Scalar & getAxisLengthRef (const size_t i=1)
const Scalar & getAxisLengthRef (const size_t i=1) const
Vector3 getAxis (const size_t i=1) const
Plane3 getSupportPlane () const
 Gets ellipse support plane.
Cylinder3 getSupportCylinder () const
Unit3 getNormal () const
void setCenter (const Point3 &center)
void setAxis (const Vector3 &axis1, const Vector3 &axis2)
void setValue (const Point3 &center, const Vector3 &axis1, const Vector3 &axis2)
void setValue (const Plane3 &plane, const Cylinder3 &cylinder)

Detailed Description

Three-dimensional ellipse class.

An ellipse is represented by a centerpoint $ \mathbf{c} $, the semimajor and semiminor axis $ a $ and $ b $, and their respective directions $ \mathbf{\hat d}_a $ and $ \mathbf{\hat d}_b $.

A point $ \mathbf{p} $ belongs to the ellipse $ \mathbf{E}(\mathbf{c}, \mathbf{\hat d}_a, \mathbf{\hat d}_b, a, b) $ if it satisfies $ \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 $ where $ \mathbf{\hat d}_a $ and $ \mathbf{\hat d}_b $ are perpendicular.

Constructor & Destructor Documentation

mt::Ellipse3::Ellipse3 ( const Point3 center,
const Vector3 axis1,
const Vector3 axis2 
)
inline

Centerpoint and semimajor-semiminor axis constructor. The axis are defined by non-unit vectors whose directions determine the ellipse plane, and whose length determines the ellipse size and shape. Also, the axis directions must be perpendicular, and if this condition is not satisfied an exception is thrown.

mt::Ellipse3::Ellipse3 ( const Plane3 plane,
const Cylinder3 cylinder 
)
inline

Constructor for plane and cylinder inputs. The ellipse is defined as the intersection of the two surfaces. If the elements do not intersect in an ellipse, an exception is thrown.

Member Function Documentation

Vector3 mt::Ellipse3::getAxis ( const size_t  i = 1) const
inline

Gets ellipse axis. If i = 1, the function returns the first axis, and in all other cases it returns the second one.

Cylinder3 mt::Ellipse3::getSupportCylinder ( ) const
inline

Gets one of the two possible cylinders that when intersected with the support plane gives rise to the current ellipse.

Point3 mt::Ellipse3::project ( const Point3 p) const
inline

Projects point p on current ellipse. This function uses an interval-based numeric solver to obtain its value, so convergence is guarranteed, and rarely takes more than 5-6 iterations.

void mt::Ellipse3::setAxis ( const Vector3 axis1,
const Vector3 axis2 
)
inline

Sets ellipse semimajor and semiminor axis. If the axis vectors are not perpendicular or have null length, an exception is thrown.

void mt::Ellipse3::setValue ( const Point3 center,
const Vector3 axis1,
const Vector3 axis2 
)
inline

Sets ellipse parameters. If the axis vectors are not perpendicular or have null length, an exception is thrown.

void mt::Ellipse3::setValue ( const Plane3 plane,
const Cylinder3 cylinder 
)
inline

Sets ellipse parameters from plane and cylinder input If the elements do not intersect in an ellipse, an exception is thrown.


The documentation for this class was generated from the following file: