A 2D line. More...
#include <GLine2D.h>
Public Member Functions | |
float | getDx () const |
float | getDy () const |
float | getFirst () const |
float | getLineCoordinate (const std::pair< float, float > &p) |
std::pair< float, float > | getPointOfCoordinate (float coord) |
The inverse of getLineCoordinate. | |
float | getSecond () const |
GLine2D () | |
Create a new line. | |
GLine2D (float slope, float b) | |
Create a new line. | |
GLine2D (float dX, float dY, const std::pair< float, float > &pt) | |
Create a new line. | |
GLine2D (const std::pair< float, float > &p1, const std::pair< float, float > &p2) | |
Create a new line through two points. | |
std::pair< float, float > | intersectionWith (const GLine2D &line) const |
Compute the point where two lines intersect, or (-1,0) if the lines are parallel. | |
Static Public Member Functions | |
static GLine2D | lsqFitXYW (const std::vector< XYWeight > &xyweights) |
Protected Member Functions | |
void | normalizeP () |
void | normalizeSlope () |
Private Attributes | |
bool | didNormalizeP |
bool | didNormalizeSlope |
float | dx |
float | dy |
std::pair< float, float > | p |
A point the line passes through; when normalized, it is the point closest to the origin (hence perpendicular to the line) |
Create a new line.
Definition at line 5 of file GLine2D.cc.
AprilTags::GLine2D::GLine2D | ( | float | slope, |
float | b | ||
) |
Create a new line.
Definition at line 8 of file GLine2D.cc.
AprilTags::GLine2D::GLine2D | ( | float | dX, |
float | dY, | ||
const std::pair< float, float > & | pt | ||
) |
Create a new line.
Definition at line 11 of file GLine2D.cc.
AprilTags::GLine2D::GLine2D | ( | const std::pair< float, float > & | p1, |
const std::pair< float, float > & | p2 | ||
) |
Create a new line through two points.
Definition at line 14 of file GLine2D.cc.
float AprilTags::GLine2D::getDx | ( | ) | const [inline] |
float AprilTags::GLine2D::getDy | ( | ) | const [inline] |
float AprilTags::GLine2D::getFirst | ( | ) | const [inline] |
float AprilTags::GLine2D::getLineCoordinate | ( | const std::pair< float, float > & | p | ) |
Get the coordinate of a point (on this line), with zero corresponding to the point on the that is perpendicular toa line passing through the origin and the line.
Definition at line 17 of file GLine2D.cc.
std::pair< float, float > AprilTags::GLine2D::getPointOfCoordinate | ( | float | coord | ) |
The inverse of getLineCoordinate.
Definition at line 22 of file GLine2D.cc.
float AprilTags::GLine2D::getSecond | ( | ) | const [inline] |
std::pair< float, float > AprilTags::GLine2D::intersectionWith | ( | const GLine2D & | line | ) | const |
Compute the point where two lines intersect, or (-1,0) if the lines are parallel.
Definition at line 27 of file GLine2D.cc.
GLine2D AprilTags::GLine2D::lsqFitXYW | ( | const std::vector< XYWeight > & | xyweights | ) | [static] |
Definition at line 54 of file GLine2D.cc.
void AprilTags::GLine2D::normalizeP | ( | ) | [protected] |
Definition at line 98 of file GLine2D.cc.
void AprilTags::GLine2D::normalizeSlope | ( | ) | [protected] |
Definition at line 89 of file GLine2D.cc.
bool AprilTags::GLine2D::didNormalizeP [private] |
bool AprilTags::GLine2D::didNormalizeSlope [private] |
float AprilTags::GLine2D::dx [private] |
float AprilTags::GLine2D::dy [private] |
std::pair<float,float> AprilTags::GLine2D::p [private] |