Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

AprilTags::GLine2D Class Reference

A 2D line. More...

#include <GLine2D.h>


Detailed Description

A 2D line.

Definition at line 15 of file GLine2D.h.

List of all members.

Public Member Functions

 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.
float getLineCoordinate (const std::pair< float, float > &p)
std::pair< float, floatgetPointOfCoordinate (float coord)
 The inverse of getLineCoordinate.
std::pair< float, floatintersectionWith (const GLine2D &line) const
 Compute the point where two lines intersect, or (-1,0) if the lines are parallel.
float getDx () const
float getDy () const
float getFirst () const
float getSecond () const

Static Public Member Functions

static GLine2D lsqFitXYW (const std::vector< XYWeight > &xyweights)

Protected Member Functions

void normalizeSlope ()
void normalizeP ()

Private Attributes

float dx
float dy
std::pair< float, floatp
 A point the line passes through; when normalized, it is the point closest to the origin (hence perpendicular to the line).
bool didNormalizeSlope
bool didNormalizeP

Constructor & Destructor Documentation

AprilTags::GLine2D::GLine2D (  ) 

Create a new line.

Definition at line 4 of file GLine2D.cc.

Referenced by lsqFitXYW().

AprilTags::GLine2D::GLine2D ( float  slope,
float  b 
)

Create a new line.

Definition at line 7 of file GLine2D.cc.

AprilTags::GLine2D::GLine2D ( float  dX,
float  dY,
const std::pair< float, float > &  pt 
)

Create a new line.

Definition at line 10 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 13 of file GLine2D.cc.


Member Function Documentation

float AprilTags::GLine2D::getDx (  )  const

Definition at line 57 of file GLine2D.h.

Referenced by intersectionWith().

float AprilTags::GLine2D::getDy (  )  const

Definition at line 58 of file GLine2D.h.

Referenced by intersectionWith().

float AprilTags::GLine2D::getFirst (  )  const

Definition at line 59 of file GLine2D.h.

Referenced by intersectionWith().

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 16 of file GLine2D.cc.

std::pair< float, float > AprilTags::GLine2D::getPointOfCoordinate ( float  coord  ) 

The inverse of getLineCoordinate.

Definition at line 21 of file GLine2D.cc.

float AprilTags::GLine2D::getSecond (  )  const

Definition at line 60 of file GLine2D.h.

Referenced by intersectionWith().

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 26 of file GLine2D.cc.

Referenced by AprilTags::TagDetector::extractTags(), and AprilTags::Quad::search().

GLine2D AprilTags::GLine2D::lsqFitXYW ( const std::vector< XYWeight > &  xyweights  )  [static]

Definition at line 53 of file GLine2D.cc.

void AprilTags::GLine2D::normalizeP (  )  [protected]

Definition at line 97 of file GLine2D.cc.

Referenced by getPointOfCoordinate().

void AprilTags::GLine2D::normalizeSlope (  )  [protected]

Definition at line 88 of file GLine2D.cc.

Referenced by getLineCoordinate(), and normalizeP().


Member Data Documentation

Definition at line 70 of file GLine2D.h.

Referenced by normalizeP().

Definition at line 69 of file GLine2D.h.

Referenced by normalizeSlope().

std::pair<float,float> AprilTags::GLine2D::p [private]

A point the line passes through; when normalized, it is the point closest to the origin (hence perpendicular to the line).

Definition at line 68 of file GLine2D.h.

Referenced by getPointOfCoordinate(), intersectionWith(), and normalizeP().


The documentation for this class was generated from the following files:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:19 2016 by Doxygen 1.6.3