Claw
1.7.3
|
A straight line in a two dimensional space. More...
#include <line_2d.hpp>
Public Types | |
typedef T | value_type |
The type of the values we store. | |
typedef line_2d< value_type > | self_type |
The type of the current class. | |
typedef coordinate_2d< value_type > | point_type |
The type of the reference point. | |
typedef vector_2d< value_type > | direction_type |
The type of the direction vector. |
Public Member Functions | |
line_2d () | |
Constructor. | |
template<class U > | |
line_2d (const line_2d< U > &that) | |
Constructor. | |
line_2d (const point_type &_origin, const direction_type &_direction) | |
Constructor with initializations. | |
line_2d (const value_type &ox, const value_type &oy, const value_type &dx, const value_type &dy) | |
Constructor with initializations. | |
bool | parallel (const self_type &that) const |
Tell if two lines are parallels. | |
bool | orthogonal (const self_type &that) const |
Tell if two lines are orthogonal. | |
point_type | intersection (const self_type &that) const |
Get the point at the intersection of two lines. | |
value_type | y_value (const value_type &x) const |
Get the y value of the point of the line at position x. |
Public Attributes | |
point_type | origin |
A reference point on the line. | |
direction_type | direction |
Direction. |
A straight line in a two dimensional space.
Definition at line 45 of file line_2d.hpp.
claw::math::line_2d< T >::line_2d | ( | const line_2d< U > & | that | ) |
claw::math::line_2d< T >::line_2d | ( | const point_type & | _origin, |
const direction_type & | _direction | ||
) |
Constructor with initializations.
_origin | A point on the line. |
_direction | The direction of the line. |
Definition at line 62 of file line_2d.tpp.
claw::math::line_2d< T >::line_2d | ( | const value_type & | ox, |
const value_type & | oy, | ||
const value_type & | dx, | ||
const value_type & | dy | ||
) |
Constructor with initializations.
ox | X-coordinate of the origin. |
oy | Y-coordinate of the origin. |
dx | X direction of the line. |
dy | Y direction of the line. |
Definition at line 77 of file line_2d.tpp.
claw::math::line_2d< T >::point_type claw::math::line_2d< T >::intersection | ( | const self_type & | that | ) | const |
Get the point at the intersection of two lines.
that | The other line. |
Definition at line 115 of file line_2d.tpp.
References claw::math::line_2d< T >::direction, claw::math::line_2d< T >::origin, claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.
bool claw::math::line_2d< T >::orthogonal | ( | const self_type & | that | ) | const |
Tell if two lines are orthogonal.
that | The other line. |
Definition at line 102 of file line_2d.tpp.
References claw::math::line_2d< T >::direction.
bool claw::math::line_2d< T >::parallel | ( | const self_type & | that | ) | const |
Tell if two lines are parallels.
that | The other line. |
Definition at line 90 of file line_2d.tpp.
References claw::math::line_2d< T >::direction, claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.
claw::math::line_2d< T >::value_type claw::math::line_2d< T >::y_value | ( | const value_type & | x | ) | const |
Get the y value of the point of the line at position x.
x | The X-coordinate for which we want the Y-coordinate. |
Definition at line 141 of file line_2d.tpp.