Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

gutk::Line Class Reference

#include <line.h>

List of all members.


Detailed Description

A class to encapsulate a line.
This class does not require a copy constructor.


Public Member Functions

 Line (void)
 Default constructor.

 Line (double x1, double y1, double x2, double y2)
 Initialises a line from (x1, y1) to (x2, y2).

virtual ~Line ()
 No need of a copy constructor and assignment operator!!

bool isLine (void)
 Returns true if this object holds a meaningfull line.

virtual double side (double x, double y)
 Returns the algebraic side on which the point (x, y) lies.

double getSlope (void)
 Returns the slope of the line.

virtual TNT::Array1D< double > equation (void)
 Returns the coefficients in the equation of the line.

virtual double distance (double x, double y)
 Returns the algebraic distance between the point (x, y) and the line.

Line getParallelLine (double d, bool s)
 Returns a gutk::Line parallel to this line at a distance d and on side s.

Line getParallelLine (double x, double y)
 Returns a gutk::Line parallel to this line and passing through the point (x, y).


Friends

State getIntersection (const Line &l1, const Line &l2, Point &p)
 A utility friend function to find out the point of intersection of two gutk::Line objects if at all they intersect.


Constructor & Destructor Documentation

gutk::Line::Line void   ) 
 

Default constructor.


Initialises a useless line object.


Member Function Documentation

virtual TNT::Array1D< double > gutk::Line::equation void   )  [virtual]
 

Returns the coefficients in the equation of the line.

If the equation of the line is written out in the form ax+by+c=0, then the returned TNT::Array1D object will be a three element array with first element a, second element b and the third element c.

double gutk::Line::getSlope void   ) 
 

Returns the slope of the line.

Returns 0 for lines initialised using the default constructor.

bool gutk::Line::isLine void   ) 
 

Returns true if this object holds a meaningfull line.

Return false for lines set using the default constructor and true otherwise.


Friends And Related Function Documentation

State getIntersection const Line l1,
const Line l2,
Point p
[friend]
 

A utility friend function to find out the point of intersection of two gutk::Line objects if at all they intersect.

The function returns the gutk::State of intersection and the point of intersection in p.


The documentation for this class was generated from the following file:
Generated on Mon Nov 22 11:12:41 2004 for ImprolaLib by doxygen 1.3.7