#include <ariaUtil.h>
Note this the theoretical line, i.e. it goes infinitely. For a line segment with endpoints, use ArLineSegment.
Public Member Functions | |
ArLine (double x1, double y1, double x2, double y2) | |
Constructor with endpoints. | |
ArLine (double a, double b, double c) | |
Constructor with parameters. | |
double | getA (void) const |
Gets the A line parameter. | |
double | getB (void) const |
Gets the B line parameter. | |
double | getC (void) const |
Gets the C line parameter. | |
virtual double | getPerpDist (const ArPose pose) const |
Calculate the distance from the given point to (its projection on) this line segment. | |
bool | getPerpPoint (ArPose pose, ArPose *perpPoint) const |
Determine the intersection point between this line segment, and a perpendicular line passing through the given pose (i.e. projects the given pose onto this line segment.). | |
virtual double | getPerpSquaredDist (const ArPose pose) const |
Calculate the squared distance from the given point to (its projection on) this line segment. | |
bool | intersects (const ArLine *line, ArPose *pose) const |
finds the intersection of this line with another line | |
void | makeLinePerp (const ArPose *pose, ArLine *line) const |
Makes the given line perpendicular to this one through the given pose. | |
void | newParameters (double a, double b, double c) |
Sets the line parameters (make it not a segment). | |
void | newParametersFromEndpoints (double x1, double y1, double x2, double y2) |
Sets the line parameters from endpoints, but makes it not a segment. | |
virtual | ~ArLine () |
Destructor. | |
Protected Attributes | |
double | myA |
double | myB |
double | myC |
virtual double ArLine::getPerpDist | ( | const ArPose | pose | ) | const [inline, virtual] |
Calculate the distance from the given point to (its projection on) this line segment.
pose | the the pose to find the perp point of |
Determine the intersection point between this line segment, and a perpendicular line passing through the given pose (i.e. projects the given pose onto this line segment.).
If there is no intersection, false is returned.
pose | The X and Y components of this pose object indicate the point to project onto this line segment. | |
perpPoint | The X and Y components of this pose object are set to indicate the intersection point |
virtual double ArLine::getPerpSquaredDist | ( | const ArPose | pose | ) | const [inline, virtual] |
Calculate the squared distance from the given point to (its projection on) this line segment.
pose | the the pose to find the perp point of |
finds the intersection of this line with another line
line | the line to check if it intersects with this line | |
pose | if the lines intersect, the pose is set to the location |