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 ¢er, 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 |
Point3 & | getCenterRef () |
const Point3 & | getCenterRef () const |
Unit3 & | getAxisDirRef (const size_t i=1) |
const Unit3 & | getAxisDirRef (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 ¢er) |
void | setAxis (const Vector3 &axis1, const Vector3 &axis2) |
void | setValue (const Point3 ¢er, const Vector3 &axis1, const Vector3 &axis2) |
void | setValue (const Plane3 &plane, const Cylinder3 &cylinder) |
Three-dimensional ellipse class.
An ellipse is represented by a centerpoint , the semimajor and semiminor axis
and
, and their respective directions
and
.
A point belongs to the ellipse
if it satisfies
where
and
are perpendicular.
|
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.
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.
|
inline |
Gets ellipse axis. If i = 1, the function returns the first axis, and in all other cases it returns the second one.
|
inline |
Gets one of the two possible cylinders that when intersected with the support plane gives rise to the current ellipse.
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.
Sets ellipse semimajor and semiminor axis. If the axis vectors are not perpendicular or have null length, an exception is thrown.
|
inline |
Sets ellipse parameters. If the axis vectors are not perpendicular or have null length, an exception is thrown.
Sets ellipse parameters from plane and cylinder input If the elements do not intersect in an ellipse, an exception is thrown.