KJB
|
Parametric representation of a 2D line in terms of three parameters (a,b,c) (as in ax+by+c = 0). More...
#include <g_line.h>
Public Member Functions | |
Line () | |
Constructor without initializations. More... | |
Line (const kjb::Vector &point_1, const kjb::Vector &point_2) | |
Constructor from two points on the line. More... | |
Line (double a, double b, double c) | |
Constructs a new Line_segment from line parameters a, b, c as in ax + by + c = 0. More... | |
Line (const kjb::Vector &iparams) | |
Constructs a new Line_segment from line parameters vector [a, b, c] as in ax + by + c = 0. More... | |
Line (const Line &l) | |
Copy constructor. More... | |
Line & | operator= (const Line &l) |
Assignment operator. More... | |
double | get_a () const |
Returns the a parameter of the line as in ax + by + c = 0. More... | |
double | get_b () const |
Returns the b parameter of the line as in ax + by + c = 0. More... | |
double | get_c () const |
Returns the c parameter of the line as in ax + by + c = 0. More... | |
const kjb::Vector & | get_params () const |
Returns the line parameters. More... | |
double | compute_y_coordinate (double ix) |
computes the y coordinate for the input x coordinate More... | |
void | set_a (double ia) |
Sets the a parameter of the line as in ax + by + c = 0. More... | |
void | set_b (double ib) |
Sets the b parameter of the line as in ax + by + c = 0. More... | |
void | set_c (double ic) |
Sets the c parameter of the line as in ax + by + c = 0. More... | |
void | set_line_params (const kjb::Vector &iparams) |
Sets the line parameters [a,b,c] of the line as in ax + by + c = 0. More... | |
bool | point_is_on_line (const Vector &point) const |
double | find_distance_to_point (const kjb::Vector &point) const |
Finds the perpendicular distance between a line and a point. More... | |
Vector | project_point_onto_line (const Vector &point) const |
Project a point onto a line. More... | |
Static Public Member Functions | |
static bool | find_line_intersection (const Line &l1, const Line &l2, kjb::Vector &ints) |
Find the intersection between two lines, Returns false if the lines are parallel. More... | |
Parametric representation of a 2D line in terms of three parameters (a,b,c) (as in ax+by+c = 0).
|
inline |
Constructor without initializations.
Line::Line | ( | const kjb::Vector & | point_1, |
const kjb::Vector & | point_2 | ||
) |
Constructor from two points on the line.
Constructor from two points on the line
point_1 | The first point |
point_2 | The second point |
|
inline |
Constructs a new Line_segment from line parameters a, b, c as in ax + by + c = 0.
|
inline |
Constructs a new Line_segment from line parameters vector [a, b, c] as in ax + by + c = 0.
|
inline |
Copy constructor.
|
inline |
computes the y coordinate for the input x coordinate
double Line::find_distance_to_point | ( | const kjb::Vector & | point | ) | const |
Finds the perpendicular distance between a line and a point.
Finds the perpendicular distance between a line and a point
point | the point to compute the distance for |
|
static |
Find the intersection between two lines, Returns false if the lines are parallel.
Finds the intersection between two lines.
l1 | the first line |
l2 | the second line |
ints | will store the intersection point |
|
inline |
Returns the a parameter of the line as in ax + by + c = 0.
|
inline |
Returns the b parameter of the line as in ax + by + c = 0.
|
inline |
Returns the c parameter of the line as in ax + by + c = 0.
|
inline |
Returns the line parameters.
|
inline |
Project a point onto a line.
|
inline |
Sets the a parameter of the line as in ax + by + c = 0.
|
inline |
Sets the b parameter of the line as in ax + by + c = 0.
|
inline |
Sets the c parameter of the line as in ax + by + c = 0.
|
inline |
Sets the line parameters [a,b,c] of the line as in ax + by + c = 0.