Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

ArLine Class Reference

#include <ariaUtil.h>

List of all members.


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


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


Member Function Documentation

virtual double ArLine::getPerpDist const ArPose  pose  )  const [inline, virtual]
 

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

Parameters:
pose the 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

bool ArLine::getPerpPoint 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:
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
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.

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.

Parameters:
pose the 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

bool ArLine::intersects const ArLine line,
ArPose pose
const [inline]
 

finds the intersection of this line with another line

Parameters:
line the line to check if it intersects with this line
pose if 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:
Generated on Thu Jan 7 10:34:42 2010 for Aria by  doxygen 1.4.2