Skip to content

Commit 5faba5c

Browse files
committed
basic documentation
1 parent 09439a8 commit 5faba5c

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed

src/conics.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ using Eigen::Vector3d;
3232
using Eigen::Matrix2d;
3333
using Eigen::Matrix3d;
3434

35+
ConicBase::ConicBase( const Matrix3d& other) : Matrix3d(other)
36+
{
37+
// Q_ASSERT( isSymmetric()==true);
38+
assert( isSymmetric()==true );
39+
}
3540

3641
Matrix3d ConicBase::skew( const Vector3d &x) const
3742
{

src/conics.h

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,70 +29,68 @@ class uStraightLine;
2929
using Eigen::Matrix3d;
3030
using Eigen::Vector3d;
3131

32+
//! Namespace Conic
3233
namespace Conic {
3334

34-
35+
//! Base class for conics
3536
class ConicBase : public Matrix3d
3637
{
3738
protected:
38-
ConicBase() = default;
39+
ConicBase() = default; //!< Standard constructor
3940
virtual ~ConicBase() = default;
4041

4142
public:
42-
ConicBase (const ConicBase &) = delete;
43-
ConicBase ( ConicBase &&) = delete;
44-
ConicBase & operator = ( const ConicBase &) = delete ;
45-
ConicBase & operator= ( ConicBase &&) = delete;
46-
ConicBase( const Matrix3d& other) : Matrix3d(other) {
47-
// Q_ASSERT( isSymmetric()==true);
48-
assert( isSymmetric()==true );
49-
}
50-
ConicBase & operator= ( const Matrix3d & other);
51-
52-
bool isEllipse() const; // obsolete
53-
bool isHyperbola() const; // obsolete
54-
bool isParabola() const; // obsolete
55-
bool isCentral() const;
56-
bool isProper() const; // obsolete
57-
58-
Vector3d center() const;
59-
Vector3d polar( const Vector3d & x ) const;
60-
std::pair<Vector3d,Vector3d> intersect( const Vector3d & l ) const;
43+
ConicBase (const ConicBase &) = delete; //!< Copy constructor
44+
ConicBase ( ConicBase &&) = delete; //!< Move constructor
45+
ConicBase & operator = ( const ConicBase &) = delete ; //!< Copy assignment operator
46+
ConicBase & operator= ( ConicBase &&) = delete; //!< Move assignment operator
47+
ConicBase( const Matrix3d & other); //!< Value constructor
48+
ConicBase & operator= ( const Matrix3d & other); //!< Assignment operator
49+
50+
bool isEllipse() const; //!< Check if conic is an ellipse (not required)
51+
bool isHyperbola() const; //!< Check if conic is a hyperbola (not required)
52+
bool isParabola() const; //!< Check if conic is a parabola (not required)
53+
bool isCentral() const; //!< Check if conic has a central point
54+
bool isProper() const; //!< Check if conic is non-degenerated
55+
56+
Vector3d center() const; //!< Get center point of conic
57+
Vector3d polar( const Vector3d & x ) const; //!< Compute polar l (straight line) for point x, i.e., l=C*x
58+
std::pair<Vector3d,Vector3d> intersect( const Vector3d & l ) const; //!< Two intersection points with a straight line
6159

6260
protected:
63-
void transform( const Matrix3d & HH );
64-
Matrix3d cof3( const Matrix3d & MM ) const; //!< 3x3 cofactor matrix
61+
void transform( const Matrix3d & HH ); //!< Transformtion of conic according to x'=H*x
62+
Matrix3d cof3( const Matrix3d & MM ) const; //!< 3x3 cofactor matrix, i.e., transposed adjunct
6563

6664
private:
6765
Matrix3d skew( const Vector3d & x ) const;
6866
bool isSymmetric() const;
6967
};
7068

7169

72-
70+
//! Ellipse
7371
class Ellipse : public ConicBase
7472
{
7573
public:
76-
Ellipse( const Uncertain::uPoint &ux, double k2=1.0 );
74+
Ellipse( const Uncertain::uPoint &ux, double k2=1.0 ); //!< Value constructor (uncertain point)
7775

78-
std::pair<Eigen::VectorXd,Eigen::VectorXd> poly( int N ) const;
79-
void scale( double s ); // obsolete
76+
std::pair<Eigen::VectorXd,Eigen::VectorXd> poly( int N ) const; //!< Get N points on ellipse
77+
void scale( double s ); //!< Scale (enlarge, shrink) the ellipse (not required)
8078

8179
using ConicBase::operator=;
8280
};
8381

8482

85-
83+
//! Hyperbola
8684
class Hyperbola : public ConicBase
8785
{
8886
public:
89-
Hyperbola( const Uncertain::uStraightLine &l, double k2=1.0 );
87+
Hyperbola( const Uncertain::uStraightLine &l, double k2=1.0 ); //!< Value constructor (uncertain straight line)
9088
using ConicBase::operator=;
9189

92-
Vector3d centerline() const;
93-
std::pair<double,double> lengthsSemiAxes() const;
94-
double angle_rad() const;
95-
double angle_deg() const;
90+
Vector3d centerline() const; //!< Get straight line
91+
std::pair<double,double> lengthsSemiAxes() const; //!< Get lengths/2 of axes
92+
double angle_rad() const; //!< Get angle between straight line and x-axis in radians.
93+
double angle_deg() const; //!< Get angle between straight line and x-axis in degerees.
9694

9795
private:
9896
std::pair<double,double> eigenvalues() const;

0 commit comments

Comments
 (0)