geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Public Attributes | List of all members
Line2D Class Reference

An oriented line section represented by the 2-dimensional coordinates of starting and terminating point. More...

#include <Line2D.h>

Collaboration diagram for Line2D:
Collaboration graph

Public Member Functions

 Line2D (const Point2D &strt, const Point2D &fini)
 
 Line2D ()
 
Point2D at (double t) const
 
Point2D turn90 () const
 
bool leftFrom (const Point2D &pt) const
 
Point2D intersectInf (const Line2D &oth) const
 

Public Attributes

Point2D pts [2]
 The terminal points of start and end. More...
 

Detailed Description

An oriented line section represented by the 2-dimensional coordinates of starting and terminating point.

Since
2013-07-03
Author
Richard J. Mathar

Constructor & Destructor Documentation

Line2D::Line2D ( const Point2D strt,
const Point2D fini 
)

Create a line that connects two given points.

Parameters
strtThe starting point.
finiThe terminal point.
Line2D::Line2D ( )

Create a line of zero length at the origin.

Member Function Documentation

Point2D Line2D::at ( double  t) const

Determine the point at line parameter t.

Parameters
tThe line parameter.
Returns
A point at distance t relative to the starting point. The point is the starting point if t=0 and the terminal point if t=1.
Point2D Line2D::turn90 ( ) const

Create a vector (i.e, a direction) with an orientation turned 90 degrees ccw.

bool Line2D::leftFrom ( const Point2D pt) const

Decide whether a point is to the left or to the right of the line (the line considered of infinite length)

Parameters
ptThe pivotal point.
Returns
True if the point to the left or on the line.
Point2D Line2D::intersectInf ( const Line2D oth) const

Determine the point of intersection between this infinite line and another infinite line.

Parameters
othThe other line (virtually extended both ways to infinity)
Returns
The point of intersection.

Member Data Documentation

Point2D Line2D::pts[2]

The terminal points of start and end.