Object representing an infinite line in 2 dimensional space.
More...
#include <cvb/line_2d.hpp>
Object representing an infinite line in 2 dimensional space.
◆ Line2D() [1/2]
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() [2/2]
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. |