Object representing an infinite line in 2 dimensional space.
More...
#include <cvb/line_2d.hpp>
|
| | Line2D () noexcept=default |
| | Create default line.
|
| |
| | Line2D (Point2D< double > normal, double distance) noexcept |
| | Create a line object.
|
| |
| | Line2D (Point2D< double > p1, Point2D< double > p2) noexcept |
| | Create a line object.
|
| |
| Point2D< double > | Normal () const noexcept |
| | Gets the normal vector of the line.
|
| |
| void | SetNormal (Point2D< double > normal) |
| | Sets the normal vector of the line.
|
| |
| double | Distance () const noexcept |
| | Gets the distance of the line from the origin.
|
| |
| void | SetDistance (double distance) noexcept |
| | Sets the distance of the line from the origin.
|
| |
| bool | operator== (const Line2D &line) const noexcept |
| | Compares to an other line.
|
| |
| bool | operator!= (const Line2D &line) const noexcept |
| | Compares to an other line.
|
| |
Object representing an infinite line in 2 dimensional space.
◆ Line2D() [1/3]
Create default line.
All members are zero, so the line is invalid!
◆ Line2D() [2/3]
Create a line object.
- Parameters
-
| [in] | normal | The normal vector of the line. |
| [in] | distance | Distance between the line and the origin. |
- Exceptions
-
| Does | not throw any exception. |
◆ Line2D() [3/3]
Create a line object.
- Parameters
-
| [in] | p1 | The first point the line is supposed to cross. |
| [in] | p2 | The second point the line is supposed to cross. |
- Exceptions
-
| Does | not throw any exception. |
◆ Distance()
| double Distance |
( |
| ) |
const |
|
inlinenoexcept |
Gets the distance of the line from the origin.
- Returns
- The distance.
- Exceptions
-
| Does | not throw any exception. |
◆ Normal()
Gets the normal vector of the line.
- Returns
- The normal vector of the line.
- Exceptions
-
| Does | not throw any exception. |
◆ operator!=()
| bool operator!= |
( |
const Line2D & | line | ) |
const |
|
inlinenoexcept |
Compares to an other line.
- Parameters
-
- Returns
- True if not equal, otherwise false.
- Exceptions
-
| Does | not throw any exception. |
◆ operator==()
| bool operator== |
( |
const Line2D & | line | ) |
const |
|
inlinenoexcept |
Compares to an other line.
- Parameters
-
- Returns
- True if equal, otherwise false.
- Exceptions
-
| Does | not throw any exception. |
◆ SetDistance()
| void SetDistance |
( |
double | distance | ) |
|
|
inlinenoexcept |
Sets the distance of the line from the origin.
- Parameters
-
| [in] | distance | The distance. |
- Exceptions
-
| Does | not throw any exception. |
◆ SetNormal()
| void SetNormal |
( |
Point2D< double > | normal | ) |
|
|
inline |
Sets the normal vector of the line.
- Parameters
-
| [in] | normal | The normal vector - it will automatically normalized to a length of 1.0. |
- Exceptions
-
| Does | not throw any exception. |