GenGeo  1.1
Line2D Class Reference

class for a line in 2D More...

#include <Line2D.h>

Inheritance diagram for Line2D:
Collaboration diagram for Line2D:

Public Member Functions

 Line2D ()
 Line2D (const Vector3 &, const Vector3 &)
Vector3 intersect (const Line2D &)
Line2D parallel (double)
virtual double getDist (const Vector3 &) const
Vector3 getOrig () const
Vector3 getNormal () const
- Public Member Functions inherited from AGeometricObject
virtual ~AGeometricObject ()

Protected Attributes

Vector3 m_p1
Vector3 m_p2
Vector3 m_normal


ostream & operator<< (ostream &, const Line2D &)

Detailed Description

class for a line in 2D

Constructor & Destructor Documentation

Line2D::Line2D ( )

default constructor -> zero all data

Referenced by parallel().

Line2D::Line2D ( const Vector3 p1,
const Vector3 p2 

Construct a line from 2 points. The order of the points determines the direction of the normal.

p11st point
p22nd point
doesn't check p1!=p2

References m_normal, m_p1, m_p2, Vector3::X(), and Vector3::Y().

Here is the call graph for this function:

Member Function Documentation

double Line2D::getDist ( const Vector3 p) const

Get the distance of a point from the line

pthe point

Implements AGeometricObject.

Reimplemented in LineSegment2D, and LineSegment2D.

References m_normal, and m_p1.

Vector3 Line2D::getNormal ( ) const

References m_normal.

Referenced by exportLine2D().

Vector3 Line2D::getOrig ( ) const

References m_p1.

Referenced by exportLine2D().

Vector3 Line2D::intersect ( const Line2D L)

Calculate the intersection with another line.

Lthe other line

References m_p1, m_p2, Vector3::X(), and Vector3::Y().

Referenced by exportLine2D().

Here is the call graph for this function:

Line2D Line2D::parallel ( double  d)

Construct a line parallel to the current line at a given distance. The direction of the normal determines on which side the parallel is constructed.

dthe distance

References Line2D(), m_normal, m_p1, and m_p2.

Referenced by exportLine2D().

Here is the call graph for this function:

Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const Line2D L 

Member Data Documentation

Vector3 Line2D::m_normal
Vector3 Line2D::m_p2

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