#include <ray2D.h>
Public Member Functions | |
| Ray2D () | |
| The default constructor initializes to the ray that starts at the origin and points along the X axis. | |
| Ray2D (const Vector2D &point, const Vector2D &direction, bool normalize=true) | |
| This constructor initializes the ray using a point and a direction. | |
| Ray2D (double aa, double bb, double cc) | |
| This constructor initializes the ray according to the equation Ax + By + C = 0. | |
| Ray2D (const Ray2D &source) | |
| The copy constructor deep copies its argument. | |
| ~Ray2D () | |
| Destructor. | |
| Ray2D & | operator= (const Ray2D &source) |
| The assignment operator deep copies its argument. | |
| const Vector2D & | getDirection () const |
| This member function returns the direction of the ray. | |
| const Vector2D & | getDirectionVector () const |
| This member function returns the direction of the ray. | |
| const Vector2D & | getOrigin () const |
| This member function returns the start point of the ray. | |
Definition at line 28 of file ray2D.h.
| dlr::geometry::Ray2D::Ray2D | ( | ) | [inline] |
| dlr::geometry::Ray2D::Ray2D | ( | const Vector2D & | point, | |
| const Vector2D & | direction, | |||
| bool | normalize = true | |||
| ) |
This constructor initializes the ray using a point and a direction.
| point | This argument specifies the start point of the ray. | |
| direction | This argument specifies the direction of the ray. | |
| normalized | If the direction vector is already normalized to unit length, then you can save some computation by setting this argument to false. |
| dlr::geometry::Ray2D::Ray2D | ( | double | aa, | |
| double | bb, | |||
| double | cc | |||
| ) |
This constructor initializes the ray according to the equation Ax + By + C = 0.
After construction, the ray origin is set to [-aa*cc / k, -bb*cc / k], where k = aa*aa + bb*bb, and the ray direction is set parallel to [-bb, aa].
| aa | This argument is the "A" coefficient of the line equation. | |
| bb | This argument is the "B" coefficient of the line equation. | |
| cc | This argument is the "C" coefficient of the line equation. |
| dlr::geometry::Ray2D::Ray2D | ( | const Ray2D & | source | ) |
| const Vector2D& dlr::geometry::Ray2D::getDirection | ( | ) | const [inline] |
This member function returns the direction of the ray.
Definition at line 104 of file ray2D.h.
Referenced by getDirectionVector().
| const Vector2D& dlr::geometry::Ray2D::getDirectionVector | ( | ) | const [inline] |
This member function returns the direction of the ray.
Definition at line 114 of file ray2D.h.
References getDirection().
| const Vector2D& dlr::geometry::Ray2D::getOrigin | ( | ) | const [inline] |
The assignment operator deep copies its argument.
| source | This argument is the class instance to be copied. |
Definition at line 65 of file ray2D.cpp.
References m_direction, and m_origin.
1.5.8