#include <linesegment2d.h>
Public Member Functions | |
double | angle () const |
double | closestPointLineSegmentRatio (const Point2D &p) const |
Point2D | closestPointTo (const Point2D &p) const |
double | distanceSqrTo (const Point2D &p, double &dx, double &dy) const |
double | distanceTo (const Point2D &p, double &dx, double &dy) const |
double | distanceTo (const Point2D &p) const |
const double | length () const |
const Line2D & | line () const |
LineSegment2D () | |
the lines endpoints More... | |
LineSegment2D (const LineSegment2D &l) | |
LineSegment2D (const Point2D &p0, const Point2D &p1) | |
LineSegment2D (const double &x0, const double &y0, const double &x1, const double &y1) | |
bool | operator== (const LineSegment2D &o) const |
comparison operator More... | |
const Point2D & | p0 () const |
const Point2D & | p1 () const |
Point2D | pc () const |
LineSegment2D & | set (const double &x0, const double &y0, const double &x1, const double &y1) |
LineSegment2D & | set (const Point2D &p0, const Point2D &p1) |
const double & | x0 () const |
const double & | x1 () const |
const double & | y0 () const |
const double & | y1 () const |
Public Member Functions inherited from tuw::Line2D | |
double & | a () |
const double & | a () const |
double & | b () |
const double & | b () const |
double & | c () |
const double & | c () const |
cv::Vec< double, 3 > & | cv () |
const cv::Vec< double, 3 > & | cv () const |
double | distanceTo (const double &x, const double &y) const |
double | distanceTo (const Point2D &p) const |
Point2D | intersection (const Line2D &l) const |
Line2D () | |
constructor More... | |
Line2D (const Line2D &l) | |
Line2D (cv::Vec< double, 3 > &l, bool normalize=true) | |
Line2D (const double &x0, const double &y0, const double &x1, const double &y1, bool normalize=true) | |
Line2D (const Point2D &pt1, const Point2D &pt2, bool normalize=true) | |
cv::Vec< double, 2 > | normal () const |
void | normalize () |
Point2D | pointOnLine (const double &x, const double &y) const |
Point2D | pointOnLine (const Point2D &p) const |
Line2D & | set (const double &x0, const double &y0, const double &x1, const double &y1, bool normalize=true) |
Line2D & | set (const Point2D &p0, const Point2D &p1, bool normalize=true) |
Polar2D | toPolar () const |
Protected Attributes | |
Point2D | p0_ |
Point2D | p1_ |
Friends | |
std::ostream & | operator<< (std::ostream &os, const LineSegment2D &o) |
class to represent a 2D line with its endpoints and as equation a*x + b*y + c = 0
Definition at line 15 of file linesegment2d.h.
LineSegment2D::LineSegment2D | ( | ) |
LineSegment2D::LineSegment2D | ( | const LineSegment2D & | l | ) |
constructor to create a line from points
p0 | |
p1 |
Definition at line 10 of file linesegment2d.cpp.
LineSegment2D::LineSegment2D | ( | const double & | x0, |
const double & | y0, | ||
const double & | x1, | ||
const double & | y1 | ||
) |
constructor to create a line from points
x0 | |
y0 | |
x1 | |
y1 |
Definition at line 15 of file linesegment2d.cpp.
double LineSegment2D::angle | ( | ) | const |
orientation of the line in space angle between -PI and PI
Definition at line 32 of file linesegment2d.cpp.
double LineSegment2D::closestPointLineSegmentRatio | ( | const Point2D & | p | ) | const |
Definition at line 96 of file linesegment2d.cpp.
computes closest point along segment
p | point |
Definition at line 105 of file linesegment2d.cpp.
double LineSegment2D::distanceSqrTo | ( | const Point2D & | p, |
double & | dx, | ||
double & | dy | ||
) | const |
computes distance to line segment
p | point |
dx | vector to point x |
dx | vector to point y |
computes squared distance to line segment
p | point |
dx | vector to point x |
dx | vector to point y |
Definition at line 82 of file linesegment2d.cpp.
double LineSegment2D::distanceTo | ( | const Point2D & | p, |
double & | dx, | ||
double & | dy | ||
) | const |
computes distance to line segment
p | point |
dx | vector to point x |
dx | vector to point y |
Definition at line 73 of file linesegment2d.cpp.
double LineSegment2D::distanceTo | ( | const Point2D & | p | ) | const |
computes distance to line segment
computes distance to line segment
p | point |
Definition at line 116 of file linesegment2d.cpp.
const double LineSegment2D::length | ( | ) | const |
Definition at line 51 of file linesegment2d.cpp.
const Line2D & LineSegment2D::line | ( | ) | const |
Definition at line 48 of file linesegment2d.cpp.
bool LineSegment2D::operator== | ( | const LineSegment2D & | o | ) | const |
comparison operator
comparison operator
Definition at line 55 of file linesegment2d.cpp.
const Point2D & LineSegment2D::p0 | ( | ) | const |
Definition at line 42 of file linesegment2d.cpp.
const Point2D & LineSegment2D::p1 | ( | ) | const |
Definition at line 45 of file linesegment2d.cpp.
Point2D LineSegment2D::pc | ( | ) | const |
Definition at line 37 of file linesegment2d.cpp.
LineSegment2D & LineSegment2D::set | ( | const double & | x0, |
const double & | y0, | ||
const double & | x1, | ||
const double & | y1 | ||
) |
LineSegment2D & LineSegment2D::set | ( | const Point2D & | p0, |
const Point2D & | p1 | ||
) |
const double & LineSegment2D::x0 | ( | ) | const |
Definition at line 20 of file linesegment2d.cpp.
const double & LineSegment2D::x1 | ( | ) | const |
Definition at line 26 of file linesegment2d.cpp.
const double & LineSegment2D::y0 | ( | ) | const |
Definition at line 23 of file linesegment2d.cpp.
const double & LineSegment2D::y1 | ( | ) | const |
Definition at line 29 of file linesegment2d.cpp.
|
friend |
Definition at line 128 of file linesegment2d.h.
|
protected |
Definition at line 17 of file linesegment2d.h.
|
protected |
Definition at line 17 of file linesegment2d.h.