#include "GeomExport.h"
#include "maxheap.h"
#include "point2.h"
#include "assert1.h"
#include <iosfwd>
Classes | |
class | DPoint2 |
Description: This class describes a 2D point using double precision x and y coordinates. More... | |
class | DRay2 |
This class describes a vector in space using an origin point p, and a unit direction vector in double precision. More... | |
Functions | |
double | Length (const DPoint2 &p) |
Returns the 'Length' of the point. More... | |
int | MaxComponent (const DPoint2 &p) |
Returns the component with the maximum absolute value. More... | |
int | MinComponent (const DPoint2 &p) |
Returns the component with the minimum absolute value. More... | |
DPoint2 | Normalize (const DPoint2 &p) |
Returns a unit vector. More... | |
DPoint2 | operator* (double m, const DPoint2 &p) |
Multiply a DPoint2 by a scalar. More... | |
DPoint2 | operator* (const DPoint2 &p, double m) |
Multiply a DPoint2 by a scalar. More... | |
DPoint2 | operator/ (const DPoint2 &p, double d) |
Divide a DPoint2 by a scalar. More... | |
std::ostream & | operator<< (std::ostream &s, const DPoint2 &p) |
Output a DPoint2 to a std::ostream as text. More... | |
Point2 | Point2FromDPoint2 (const DPoint2 &from) |
double | DotProd (const DPoint2 &a, const DPoint2 &b) |
Returns the dot product of two DPoint2s. More... | |
int | DoublePrecisionLineSegmentIntersection (const DPoint2 &seg1Start, const DPoint2 &seg1End, const DPoint2 &seg2Start, const DPoint2 &seg2End, DPoint2 &intersectPoint) |
Double-Precision Line Segment Intersection test. More... | |
int | DoublePrecisionLineIntersection (const DPoint2 &line1PointA, const DPoint2 &line1PointB, const DPoint2 &line2PointA, const DPoint2 &line2PointB, DPoint2 &intersectPoint) |
Double-Precision Line Intersection test. More... | |
|
inline |
Returns the 'Length' of the point.
This is sqrt(v.x*v.x+v.y*v.y)
p | the DPoint2 to test |
Returns the component with the maximum absolute value.
p | the DPoint2 to test |
Returns the component with the minimum absolute value.
0=x, 1=y.
p | the DPoint2 to test |
std::ostream& operator<< | ( | std::ostream & | s, |
const DPoint2 & | p | ||
) |
int DoublePrecisionLineSegmentIntersection | ( | const DPoint2 & | seg1Start, |
const DPoint2 & | seg1End, | ||
const DPoint2 & | seg2Start, | ||
const DPoint2 & | seg2End, | ||
DPoint2 & | intersectPoint | ||
) |
Double-Precision Line Segment Intersection test.
Determines if two line segments intersect.
seg1Start | endpoint 1 for the first line segment |
seg1End | endpoint 2 for the first line segment |
seg2Start | endpoint 1 for the second line segment |
seg2End | endpoint 2 for the second line segment |
intersectPoint | if the lines intersect, this will return the intersection point. |
int DoublePrecisionLineIntersection | ( | const DPoint2 & | line1PointA, |
const DPoint2 & | line1PointB, | ||
const DPoint2 & | line2PointA, | ||
const DPoint2 & | line2PointB, | ||
DPoint2 & | intersectPoint | ||
) |
Double-Precision Line Intersection test.
Determines if two infinite lines cross, and if so, where.
line1PointA | point 1 on the first line |
line1PointB | point 2 on the first line |
line2PointA | point 1 on the second line |
line2PointB | point 2 on the second line |
intersectPoint | if the lines intersect, this will return the intersection point. |