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

Cylinder class. More...

#include <cylinder3.h>

Public Member Functions

 Cylinder3 ()
 Cylinder3 (const Line3 &axis, const Scalar &radius)
bool operator== (const Cylinder3 &c) const
bool operator!= (const Cylinder3 &c) const
Point3 project (const Point3 &p) const
 Projects point p on current cylinder.
Scalar distance (const Point3 &p) const
Line3 getAxis () const
Line3getAxisRef ()
const Line3getAxisRef () const
Scalar getRadius () const
Scalar & getRadiusRef ()
const Scalar & getRadiusRef () const
void setAxis (const Line3 &axis)
void setRadius (const Scalar &radius)
void setValue (const Line3 &axis, const Scalar &radius)
bool isSingular () const
 Returns true if cylinder has null radius.

Detailed Description

Cylinder class.

This class represents a cylinder with circular cross-section of infinite length.

Cylinders are represented by a line (axis) and a radius. A point $ \mathbf{p} $ belongs to the cylinder $ \mathbf{C}(\mathcal{L}, r) $ if $ d(\mathbf{p}, \mathcal{L}) = r $, where $ \mathcal{L} $ and $ r $ represent the cylinder axis and radius, respectively.

Constructor & Destructor Documentation

mt::Cylinder3::Cylinder3 ( )
inline

Default constructor. Creates a cylinder with unit radius along the z axis.

mt::Cylinder3::Cylinder3 ( const Line3 axis,
const Scalar &  radius 
)
inline

Axis and radius constructor. Since the radius must be a positive value, its absolute value is taken (just in case) without issuing warnings or errors.

Member Function Documentation

Scalar mt::Cylinder3::distance ( const Point3 p) const
inline

Signed distance from point p to current cylinder.

Positive distance -> Point lies outside the cylinder. Null distance -> Point is contained in cylinder. Negative distance -> Point lies inside the cylinder.

void mt::Cylinder3::setRadius ( const Scalar &  radius)
inline

Sets cylinder radius. Since the radius must be a positive value, its absolute value is taken (just in case) without issuing warnings or errors.

void mt::Cylinder3::setValue ( const Line3 axis,
const Scalar &  radius 
)
inline

Sets cylinder parameters. Since the radius must be a positive value, its absolute value is taken (just in case) without issuing warnings or errors.


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