This struct represents a vertical 2D line or a line of the form y = mx + b.
More...
#include <Line2.h>
|
| Line2 (const float &m, const float &b) |
| A constructor that creates a non-vertical line from the two parameters that describe a 2D line. More...
|
|
| Line2 (Geometry::Vec2 &u, Geometry::Vec2 &v) |
| A constructor that creates a line from two points. More...
|
|
boost::optional< float > | eval (const float &x) |
| Evaluate the line function for a given x. More...
|
|
|
boost::optional< float > | m |
| The slope of the line. More...
|
|
boost::optional< float > | b |
| The y-intersect of the line. More...
|
|
boost::optional< float > | xpos |
| The x value of a vertical line. More...
|
|
bool | vertical |
| Indicate if this line is vertical. More...
|
|
This struct represents a vertical 2D line or a line of the form y = mx + b.
◆ Line2() [1/2]
Pathfinder::Line2::Line2 |
( |
const float & |
m, |
|
|
const float & |
b |
|
) |
| |
A constructor that creates a non-vertical line from the two parameters that describe a 2D line.
- Parameters
-
m | The slope of the line. |
b | The y-intercept of the line. |
◆ Line2() [2/2]
Pathfinder::Line2::Line2 |
( |
Geometry::Vec2 & |
u, |
|
|
Geometry::Vec2 & |
v |
|
) |
| |
A constructor that creates a line from two points.
The necessary parameters are calculated from the two given points.
- Parameters
-
u | The first point. |
v | The second point. |
◆ eval()
boost::optional< float > Pathfinder::Line2::eval |
( |
const float & |
x | ) |
|
Evaluate the line function for a given x.
- Parameters
-
x | The point at where the line function shall be evaluated. |
- Returns
- Return the corresponding y value to the given input if the line is not vertical. Return boost::none if the line is vertical.
boost::optional<float> Pathfinder::Line2::b |
The y-intersect of the line.
boost::optional<float> Pathfinder::Line2::m |
◆ vertical
bool Pathfinder::Line2::vertical |
Indicate if this line is vertical.
◆ xpos
boost::optional<float> Pathfinder::Line2::xpos |
The x value of a vertical line.
The documentation for this struct was generated from the following files: