A three dimensional line segment. More...
#include <ignition/math/Line3.hh>
Public Member Functions | |
Line3 ()=default | |
Line Constructor. More... | |
Line3 (const Line3< T > &_line) | |
Copy constructor. More... | |
Line3 (const math::Vector3< T > &_ptA, const math::Vector3< T > &_ptB) | |
Constructor. More... | |
Line3 (const double _x1, const double _y1, const double _x2, const double _y2) | |
2D Constructor where Z coordinates are 0 More... | |
Line3 (const double _x1, const double _y1, const double _z1, const double _x2, const double _y2, const double _z2) | |
Constructor. More... | |
math::Vector3< T > | Direction () const |
Get the direction of the line. More... | |
T | Length () const |
Get the length of the line. More... | |
bool | operator!= (const Line3< T > &_line) const |
Inequality operator. More... | |
Line3 & | operator= (const Line3< T > &_line) |
Assignment operator. More... | |
bool | operator== (const Line3< T > &_line) const |
Equality operator. More... | |
math::Vector3< T > | operator[] (const size_t _index) const |
Get the start or end point. More... | |
void | Set (const math::Vector3< T > &_ptA, const math::Vector3< T > &_ptB) |
Set the start and end point of the line segment. More... | |
void | Set (const double _x1, const double _y1, const double _x2, const double _y2, const double _z=0) |
Set the start and end point of the line segment, assuming that both points have the same height. More... | |
void | Set (const double _x1, const double _y1, const double _z1, const double _x2, const double _y2, const double _z2) |
Set the start and end point of the line segment. More... | |
void | SetA (const math::Vector3< T > &_ptA) |
Set the start point of the line segment. More... | |
void | SetB (const math::Vector3< T > &_ptB) |
Set the end point of the line segment. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const Line3< T > &_line) |
Stream extraction operator. More... | |
A three dimensional line segment.
The line is defined by a start and end point.
|
default |
Line Constructor.
|
inline |
Copy constructor.
[in] | _line | a line object |
|
inline |
Constructor.
[in] | _ptA | Start point of the line segment |
[in] | _ptB | End point of the line segment |
References ignition::math::Line3< T >::Set().
|
inline |
2D Constructor where Z coordinates are 0
[in] | _x1 | X coordinate of the start point. |
[in] | _y1 | Y coordinate of the start point. |
[in] | _x2 | X coordinate of the end point. |
[in] | _y2 | Y coordinate of the end point. |
References ignition::math::Line3< T >::Set().
|
inline |
Constructor.
[in] | _x1 | X coordinate of the start point. |
[in] | _y1 | Y coordinate of the start point. |
[in] | _z1 | Z coordinate of the start point. |
[in] | _x2 | X coordinate of the end point. |
[in] | _y2 | Y coordinate of the end point. |
[in] | _z2 | Z coordinate of the end point. |
References ignition::math::Line3< T >::Set().
|
inline |
Get the direction of the line.
|
inline |
Get the length of the line.
|
inline |
Inequality operator.
[in] | _line | Line to compare for inequality. |
|
inline |
Assignment operator.
[in] | _line | a new value |
|
inline |
Equality operator.
[in] | _line | Line to compare for equality. |
|
inline |
Get the start or end point.
[in] | _index | 0 = start point, 1 = end point. |
IndexException | if _index is > 1. |
|
inline |
Set the start and end point of the line segment.
[in] | _ptA | Start point of the line segment |
[in] | _ptB | End point of the line segment |
Referenced by ignition::math::Line3< T >::Line3().
|
inline |
Set the start and end point of the line segment, assuming that both points have the same height.
[in] | _x1 | X coordinate of the start point. |
[in] | _y1 | Y coordinate of the start point. |
[in] | _x2 | X coordinate of the end point. |
[in] | _y2 | Y coordinate of the end point. |
[in] | _z | Z coordinate of both points, by default _z is set to 0. |
|
inline |
Set the start and end point of the line segment.
[in] | _x1 | X coordinate of the start point. |
[in] | _y1 | Y coordinate of the start point. |
[in] | _z1 | Z coordinate of the start point. |
[in] | _x2 | X coordinate of the end point. |
[in] | _y2 | Y coordinate of the end point. |
[in] | _z2 | Z coordinate of the end point. |
|
inline |
Set the start point of the line segment.
[in] | _ptA | Start point of the line segment |
|
inline |
Set the end point of the line segment.
[in] | _ptB | End point of the line segment |
|
friend |
Stream extraction operator.
[in] | _out | output stream |
[in] | _line | Line3 to output |