Aria  2.8.0
ArLine Class Reference

Represents geometry of a line in two-dimensional space. More...

#include <ariaUtil.h>

Public Member Functions

 ArLine (double a, double b, double c)
 Constructor with parameters.
 
 ArLine (double x1, double y1, double x2, double y2)
 Constructor with endpoints.
 
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. More...
 
bool getPerpPoint (const 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.) More...
 
virtual double getPerpSquaredDist (const ArPose &pose) const
 Calculate the squared distance from the given point to (its projection on) this line segment. More...
 
bool intersects (const ArLine *line, ArPose *pose) const
 finds the intersection of this line with another line More...
 
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 bool operator!= (const ArLine &other) const
 Inequality operator.
 
virtual bool operator== (const ArLine &other) const
 Equality operator.
 
virtual ~ArLine ()
 Destructor.
 

Protected Attributes

double myA
 
double myB
 
double myC
 

Detailed Description

Represents geometry of a line in two-dimensional space.

Note this the theoretical line, i.e. it goes infinitely. For a line segment with endpoints, use ArLineSegment.

See also
ArLineSegment

Member Function Documentation

◆ getPerpDist()

virtual double ArLine::getPerpDist ( const ArPose pose) const
inlinevirtual

Calculate the distance from the given point to (its projection on) this line segment.

Parameters
posethe the pose to find the perp point of
Returns
if the pose does not intersect line it will return < 0 if the pose intersects the segment it will return the distance to the intersection

◆ getPerpPoint()

bool ArLine::getPerpPoint ( const ArPose pose,
ArPose perpPoint 
) const
inline

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.

Parameters
poseThe X and Y components of this pose object indicate the point to project onto this line segment.
perpPointThe X and Y components of this pose object are set to indicate the intersection point
Returns
true if an intersection was found and perpPoint was modified, false otherwise.

Java and Python Wrappers: Not available in Java or Python wrapper libraries.

◆ getPerpSquaredDist()

virtual double ArLine::getPerpSquaredDist ( const ArPose pose) const
inlinevirtual

Calculate the squared distance from the given point to (its projection on) this line segment.

Parameters
posethe the pose to find the perp point of
Returns
if the pose does not intersect line it will return < 0 if the pose intersects the segment it will return the distance to the intersection

◆ intersects()

bool ArLine::intersects ( const ArLine line,
ArPose pose 
) const
inline

finds the intersection of this line with another line

Parameters
linethe line to check if it intersects with this line
poseif the lines intersect, the pose is set to the location
Returns
true if they intersect, false if they do not

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