|
ActiveLib
|
Class to represent a linear equation. More...
#include <LinEquation.h>
Public Types | |
| using | Unique = std::unique_ptr<LinEquation> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<LinEquation> |
| Shared pointer. | |
| using | Option = std::optional<LinEquation> |
| Optional. | |
Public Member Functions | |
| LinEquation () | |
| LinEquation (double angle, const Point &source=Point()) | |
| LinEquation (const LinEquation &source) | |
| LinEquation & | operator= (const LinEquation &source) |
| bool | operator== (const LinEquation &ref) const |
| bool | operator== (const Point &ref) const |
| bool | operator!= (const LinEquation &ref) const |
| bool | operator< (const LinEquation &ref) const |
| bool | isXAxis (double prec=math::eps) const |
| bool | isYAxis (double prec=math::eps) const |
| bool | isPerpendicularTo (const LinEquation &ref, double prec=math::eps) const |
| bool | isParallelTo (const LinEquation &ref, double prec=math::eps) const |
| double | azimuthAngle () const |
| Option | getFlipped () const |
| Option | getPerpendicular (const Point &ref) const |
| Option | getParallel (const Point &ref) const |
| double | angleTo (const LinEquation &ref) const |
| XPoint::Option | intersectionWith (const LinEquation &ref) const |
| Position | positionOf (const Point &ref, double prec=math::eps) const |
| bool | xAtY (double y, double &x) const |
| bool | yAtX (double x, double &y) const |
| Point | closestPointTo (const Point &ref) const |
| double | lengthTo (const Point &ref) const |
Static Public Member Functions | |
| static Option | create (const Point &source) |
| static Option | create (const Point &start, const Point &end) |
| static Option | create (const Line &source) |
Class to represent a linear equation.
| LinEquation::LinEquation | ( | ) |
Constructor
Constructor
| angle | Angle of the line |
| source | A point along the line |
| LinEquation::LinEquation | ( | const LinEquation & | source | ) |
Copy constructor
| source | The object to copy |
| double LinEquation::angleTo | ( | const LinEquation & | ref | ) | const |
Calculate the angle between two linear equations
| ref | The reference line |

| double LinEquation::azimuthAngle | ( | ) | const |
Calculate the angle of this equation


Calculate the closest point along this to a another specified point
| ref | The reference point |


|
static |
Create a new linear equation from a line
| source | A line |
|
static |
Create a new linear equation from a point (origin assumed to be 0,0,0)
| source | The end of the line |

|
static |
Create a new linear equation from two points in a line
| start | The start of the line |
| end | The end of the line |
| LinEquation::Option LinEquation::getFlipped | ( | ) | const |
Create a linear equation opposite to this
| LinEquation::Option LinEquation::getParallel | ( | const Point & | ref | ) | const |
Create a linear equation parallel to this which passes through the specified point
| ref | The point through which the new equation must pass |

| LinEquation::Option LinEquation::getPerpendicular | ( | const Point & | ref | ) | const |
Create a linear equation perpendicular to this which passes through the specified point
| ref | The point through which the new equation must pass |

| XPoint::Option LinEquation::intersectionWith | ( | const LinEquation & | ref | ) | const |
Calculate the intersection point of two equations
| ref | The intersecting line |


| bool LinEquation::isParallelTo | ( | const LinEquation & | ref, |
| double | prec = math::eps ) const |
Test two equations to determine if they are parallel
| ref | The reference line |
| prec | The required precision |


| bool LinEquation::isPerpendicularTo | ( | const LinEquation & | ref, |
| double | prec = math::eps ) const |
Test two equations to determine if they are perpendicular
| ref | The reference line |
| prec | The required precision |

|
inline |
Test if the equation is parallel to the x axis
| prec | The required precision |

|
inline |
Test if the equation is parallel to the y axis
| prec | The required precision |

| double LinEquation::lengthTo | ( | const Point & | ref | ) | const |
Calculate the minimum distance from a point to this
| ref | The reference point |


|
inline |
Inequality operator
| ref | The object to compare |
| bool LinEquation::operator< | ( | const LinEquation & | ref | ) | const |
Less-than operator
| ref | The object to compare |

| LinEquation & LinEquation::operator= | ( | const LinEquation & | source | ) |
Assignment operator
| source | The object to copy |
| bool LinEquation::operator== | ( | const LinEquation & | ref | ) | const |
Equality operator
| ref | The object to compare |

| bool LinEquation::operator== | ( | const Point & | ref | ) | const |
Test to determine if a point lies within this equation
| ref | A point to test |

Determine the relationship of a point to the equation
| ref | The point to test |
| prec | The required precision |


| bool LinEquation::xAtY | ( | double | y, |
| double & | x ) const |
Calculate the x coordinate at the specifed y coordinate
| y | The y coordinate |
| x | The x coordinate (n/a if the equation is parallel to the x axis) |

| bool LinEquation::yAtX | ( | double | x, |
| double & | y ) const |
Calculate the y coordinate at the specifed x coordinate
| x | The x coordinate |
| y | The y coordinate (n/a if the equation is parallel to the y axis) |
