The AreaCon Library  1.0
A C++ library for area-constrained partitioning operations
 All Classes Namespaces Files Functions Variables Pages
AreaCon::Point Class Reference

#include <areacon.h>

Public Member Functions

 Point (const double x=INFINITY, const double y=INFINITY)
 
double Norm () const
 
Point AddPoint (const Point Test) const
 
Point FindPerpDirection (const Point Test, const double Norm) const
 
void FlipDirection (void)
 
double PerpDistanceToLine (const Point Test1, const Point Test2) const
 
bool AreCollinear (const Point Test1, const Point Test2) const
 
bool AreBetween (const Point Test1, const Point Test2) const
 
void Mult (const double factor)
 

Static Public Member Functions

static bool IsEqual (const Point Test1, const Point Test2)
 
static double Distance (const Point Test1, const Point Test2)
 
static Point FindPointAlongLine (const Point Test1, const Point Test2, const double distance)
 
static double Norm (const Point Test)
 
static Point AddPoints (const Point Test1, const Point Test2)
 
static Point FindPerpDirection (const Point Test1, const Point Test2, const double Norm)
 
static double PerpDistanceToLine (const Point Test1, const Point Test2, const Point Test3)
 
static bool AreCollinear (const Point Test1, const Point Test2, const Point Test3)
 
static bool AreBetween (const Point Test1, const Point Test2, const Point Test3)
 
static std::vector< PointFindCollinearIntersection (const Point p1, const Point p2, const Point p3, const Point p4)
 

Public Attributes

double x
 
double y
 

Static Public Attributes

static double Robustness_Constant
 

Detailed Description

The base class for defining a point in the two-dimensional plane.

Author
Jeffrey R. Peters

Constructor & Destructor Documentation

AreaCon::Point::Point ( const double  x = INFINITY,
const double  y = INFINITY 
)

Default Constructor

Parameters
[in]xThe x coordinate
[in]yThe y coordinate

Member Function Documentation

Point AreaCon::Point::AddPoint ( const Point  Test) const

Adds the point Test to the current point component-wise

Returns
Sum = Point(Test.x+x, Test.y+y)
Point AreaCon::Point::AddPoints ( const Point  Test1,
const Point  Test2 
)
static

Adds the points Test1, Test2 component-wise

Parameters
[in]Test1The first summand
[in]Test2The second summand
Returns
Sum of the points Test1, Test2
bool AreaCon::Point::AreBetween ( const Point  Test1,
const Point  Test2 
) const

Tests to see if the point object lies (numerically) on the line between Test1, Test2

Parameters
[in]Test1The first test point
[in]Test2The second test point
Returns
Indicator stating if point object is between the test points
bool AreaCon::Point::AreBetween ( const Point  Test1,
const Point  Test2,
const Point  Test3 
)
static

Tests to see if Test3 lies (numerically) on the line between Test1, Test2

Parameters
[in]Test1The first test point
[in]Test2The second test point
[in]Test3The third test point
Returns
Indicator stating if point object is between the test points
bool AreaCon::Point::AreCollinear ( const Point  Test1,
const Point  Test2 
) const

Tests to see if the points Test1, Test2 are numerically collinear with the point object.

Parameters
[in]Test1The first test point
[in]Test2The second test point
Returns
Indicator of collinearity
bool AreaCon::Point::AreCollinear ( const Point  Test1,
const Point  Test2,
const Point  Test3 
)
static

Tests to see if Test3 lies (numerically) on the line between Test1, Test2

Parameters
[in]Test1The first test point
[in]Test2The second test point
[in]Test3The third test point
Returns
Indicator stating if point object is between the test points
double AreaCon::Point::Distance ( const Point  Test1,
const Point  Test2 
)
static

Finds the Euclidean distance between the points Test1, Test2.

Parameters
[in]Test1The first test point
[in]Test2The second test point
Returns
Euclidean distance
std::vector< Point > AreaCon::Point::FindCollinearIntersection ( const Point  p1,
const Point  p2,
const Point  p3,
const Point  p4 
)
static

Returns the end-points of the line which forms the intersection of the lines connecting p1, p2 and p3, p4, respectively. Note that p1,p2,p3,p4 must be collinear. If the lines do not intersect, or only intersect at a single point, the return vector will contain less than 2 entries

Parameters
[in]p1The first end-point of the first line
[in]p2The second end-point of the first line
[in]p3The first end-point of the second line
[in]p4The second end-point of the second line
Returns
A vector containing the end-points of the intersection line;
Point AreaCon::Point::FindPerpDirection ( const Point  Test,
const double  Norm 
) const

Returns a point (vector) of length Norm that points in a direction perpendicular to the line between Test and the current point.

Parameters
[in]TestThe test point
[in]NormThe desired norm of the resulting point (vector)
Returns
Perpendicular Point
Point AreaCon::Point::FindPerpDirection ( const Point  Test1,
const Point  Test2,
const double  Norm 
)
static

Returns a point (vector) of length Norm that points in a direction perpendicular to the line between Test1 and Test2

Parameters
[in]Test1The first test point
[in]Test2The second test point
[in]NormThe desired norm of the resulting point (vector)
Returns
Perpendicular Point
Point AreaCon::Point::FindPointAlongLine ( const Point  Test1,
const Point  Test2,
const double  distance 
)
static

Finds a point along the line connecting Test1, Test2 that is a normalized distance away from the point Test1, e.g, distance = 0.5 corresponds to the point that is exactly half-way between Test1, Test2.

Parameters
[in]Test1The first test point
[in]Test2The second test point
[in]distanceThe normalized distance along the line connecting Test1, Test2
Returns
The resulting point along the line
void AreaCon::Point::FlipDirection ( void  )

Reverses the orientation of the current point (vector), i.e., multiplies by -1

bool AreaCon::Point::IsEqual ( const Point  Test1,
const Point  Test2 
)
static

Tests to see if Test1, Test2 are equal.

Parameters
[in]Test1The first test point
[in]Test2The second test point
Returns
Equality indicator
void AreaCon::Point::Mult ( const double  factor)

Multiplies the point object (vector) by a constant factor

Parameters
[in]factorThe multiplication factor
double AreaCon::Point::Norm ( ) const

Calculates the Euclidean norm of the point

Returns
Euclidean norm
double AreaCon::Point::Norm ( const Point  Test)
static

Finds the Euclidean norm of the point Test

Parameters
[in]TestThe test point
Returns
The Euclidean distance
double AreaCon::Point::PerpDistanceToLine ( const Point  Test1,
const Point  Test2 
) const

Finds the perpendicular distance of the point to the line connecting Test1, Test2

Parameters
[in]Test1The first test point
[in]Test2The second test Point
Returns
The perpendicular distance
double AreaCon::Point::PerpDistanceToLine ( const Point  Test1,
const Point  Test2,
const Point  Test3 
)
static

Finds the perpendicular distance of Test3 to the line connecting Test1, Test2

Parameters
[in]Test1The first point defining the line
[in]Test2The second point defining the line
[in]Test3The test point
Returns
The perpendicular distance

Member Data Documentation

double AreaCon::Point::Robustness_Constant
static

A constant used to enhance numerical robustness. Loosely, when a Euclidean distance is less than the robustness constant, the distance is considered to be 0.

double AreaCon::Point::x
double AreaCon::Point::y

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