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