The AreaCon Library
1.0
A C++ library for area-constrained partitioning operations
|
#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< Point > | FindCollinearIntersection (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 |
The base class for defining a point in the two-dimensional plane.
AreaCon::Point::Point | ( | const double | x = INFINITY , |
const double | y = INFINITY |
||
) |
Default Constructor
[in] | x | The x coordinate |
[in] | y | The y coordinate |
Adds the point Test to the current point component-wise
Adds the points Test1, Test2 component-wise
[in] | Test1 | The first summand |
[in] | Test2 | The second summand |
Tests to see if the point object lies (numerically) on the line between Test1, Test2
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
Tests to see if Test3 lies (numerically) on the line between Test1, Test2
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
[in] | Test3 | The third test point |
Tests to see if the points Test1, Test2 are numerically collinear with the point object.
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
|
static |
Tests to see if Test3 lies (numerically) on the line between Test1, Test2
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
[in] | Test3 | The third test point |
Finds the Euclidean distance between the points Test1, Test2.
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
|
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
[in] | p1 | The first end-point of the first line |
[in] | p2 | The second end-point of the first line |
[in] | p3 | The first end-point of the second line |
[in] | p4 | The second end-point of the second line |
Returns a point (vector) of length Norm that points in a direction perpendicular to the line between Test and the current point.
[in] | Test | The test point |
[in] | Norm | The desired norm of the resulting point (vector) |
|
static |
Returns a point (vector) of length Norm that points in a direction perpendicular to the line between Test1 and Test2
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
[in] | Norm | The desired norm of the resulting point (vector) |
|
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.
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
[in] | distance | The normalized distance along the line connecting Test1, Test2 |
void AreaCon::Point::FlipDirection | ( | void | ) |
Reverses the orientation of the current point (vector), i.e., multiplies by -1
Tests to see if Test1, Test2 are equal.
[in] | Test1 | The first test point |
[in] | Test2 | The second test point |
void AreaCon::Point::Mult | ( | const double | factor | ) |
Multiplies the point object (vector) by a constant factor
[in] | factor | The multiplication factor |
double AreaCon::Point::Norm | ( | ) | const |
Calculates the Euclidean norm of the point
|
static |
Finds the Euclidean norm of the point Test
[in] | Test | The test point |
Finds the perpendicular distance of the point to the line connecting Test1, Test2
[in] | Test1 | The first test point |
[in] | Test2 | The second test Point |
|
static |
Finds the perpendicular distance of Test3 to the line connecting Test1, Test2
[in] | Test1 | The first point defining the line |
[in] | Test2 | The second point defining the line |
[in] | Test3 | The test point |
|
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 |