KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
Loading...
Searching...
No Matches
Ellipse Class Reference

A 2D ellipse defined by a centre point and two semi-axis lengths. More...

#include <ellipse.h>

Public Member Functions

 Ellipse ()
 Default constructor — creates a degenerate ellipse at the origin.
 
 Ellipse (const Point &center, double semiAxisA, double semiAxisB)
 Construct an ellipse from a centre point and semi-axis lengths.
 
Point center () const
 Return the centre of the ellipse.
 
void setCenter (const Point &value)
 Set the centre of the ellipse.
 
double semiAxisA () const
 Return the horizontal semi-axis length.
 
void setSemiAxisA (double value)
 Set the horizontal semi-axis length.
 
double semiAxisB () const
 Return the vertical semi-axis length.
 
void setSemiAxisB (double value)
 Set the vertical semi-axis length.
 
double radiusAtAngle (double angle) const
 radiusAtAngle
 
QString toString () const
 Format the ellipse as a human-readable string.
 

Detailed Description

A 2D ellipse defined by a centre point and two semi-axis lengths.

Represents an axis-aligned 2D ellipse with semi-axes A (horizontal) and B (vertical).

Definition at line 11 of file ellipse.h.

Constructor & Destructor Documentation

◆ Ellipse() [1/2]

Ellipse::Ellipse ( )
inline

Default constructor — creates a degenerate ellipse at the origin.

Definition at line 15 of file ellipse.h.

◆ Ellipse() [2/2]

Ellipse::Ellipse ( const Point center,
double  semiAxisA,
double  semiAxisB 
)
inline

Construct an ellipse from a centre point and semi-axis lengths.

Parameters
centerCentre of the ellipse
semiAxisAHalf-length of the horizontal axis
semiAxisBHalf-length of the vertical axis

Definition at line 23 of file ellipse.h.

Member Function Documentation

◆ center()

Point Ellipse::center ( ) const
inline

Return the centre of the ellipse.

Returns
Centre Point

Definition at line 30 of file ellipse.h.

◆ radiusAtAngle()

double Ellipse::radiusAtAngle ( double  angle) const

radiusAtAngle

Parameters
anglein degrees offset from vertical (north) at zero
Returns
The radius at the given angle.

◆ semiAxisA()

double Ellipse::semiAxisA ( ) const
inline

Return the horizontal semi-axis length.

Returns
Semi-axis A (horizontal half-width)

Definition at line 42 of file ellipse.h.

◆ semiAxisB()

double Ellipse::semiAxisB ( ) const
inline

Return the vertical semi-axis length.

Returns
Semi-axis B (vertical half-height)

Definition at line 54 of file ellipse.h.

◆ setCenter()

void Ellipse::setCenter ( const Point value)
inline

Set the centre of the ellipse.

Parameters
valueNew centre point

Definition at line 36 of file ellipse.h.

◆ setSemiAxisA()

void Ellipse::setSemiAxisA ( double  value)
inline

Set the horizontal semi-axis length.

Parameters
valueNew semi-axis A value

Definition at line 48 of file ellipse.h.

◆ setSemiAxisB()

void Ellipse::setSemiAxisB ( double  value)
inline

Set the vertical semi-axis length.

Parameters
valueNew semi-axis B value

Definition at line 60 of file ellipse.h.

◆ toString()

QString Ellipse::toString ( ) const

Format the ellipse as a human-readable string.

Returns
String representation of centre and semi-axes

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