1 #ifndef GEOMETRY_RAYPRIMITIVES_H 2 #define GEOMETRY_RAYPRIMITIVES_H 39 if(awZero == bwZero)
return a-b;
53 if(awZero == bwZero)
return a-b;
54 else if(awZero)
return a;
63 if(p1.isRay != p2.isRay) {
65 if(p1.x < 0)
return true;
66 else if(p1.x > 0)
return false;
67 if(p2.x > 0)
return true;
68 else if(p2.x < 0)
return false;
74 if(p1.x < p2.x)
return true;
75 else if(p1.x > p2.x)
return false;
83 if(p1.isRay != p2.isRay) {
85 if(p1.x < 0)
return true;
86 else if(p1.x > 0)
return false;
87 if(p2.x > 0)
return true;
88 else if(p2.x < 0)
return false;
90 if(p1.y < 0)
return true;
91 else if(p1.y > 0)
return false;
92 if(p2.y > 0)
return true;
93 else if(p2.y < 0)
return false;
99 if(p1.x < p2.x)
return true;
100 else if(p1.x > p2.x)
return false;
101 if(p1.y < p2.y)
return true;
102 else if(p1.y > p2.y)
return false;
103 return (p1.z < p2.z);
114 return (p1.x - p0.x)*(p2.y - p0.y) - (p2.x - p0.x)*(p1.y - p0.y);
121 Real bx = p1.isRay ? p1.x : p1.x - p0.x;
122 Real by = p1.isRay ? p1.y : p1.y - p0.y;
123 Real cx = p2.isRay ? p2.x : p2.x - p0.x;
124 Real cy = p2.isRay ? p2.y : p2.y - p0.y;
136 out<<pt.x<<
" "<<pt.y;
137 if(pt.isRay) out<<
" (ray)";
A 3D point or infinite ray. Note: rays should be normalized unit vectors.
Definition: rayprimitives.h:24
A 3D vector class.
Definition: math3d/primitives.h:136
Real HomogeneousCmp(Real a, bool awZero, Real b, bool bwZero)
Comparison of 1D points in homogeneous coordinates.
Definition: rayprimitives.h:37
Definition: rayprimitives.h:132
Real OrientRay2D(const PointRay2D &p0, const PointRay2D &p1, const PointRay2D &p2)
Definition: rayprimitives.h:108
Contains ordering primitives used in geometry computations.
Real HomogeneousSub(Real a, bool awZero, Real b, bool bwZero)
Subtraction of 1D points in homogeneous coordinates.
Definition: rayprimitives.h:51
A 2D point or infinite ray. Note: rays should be normalized unit vectors.
Definition: rayprimitives.h:18
bool LexicalRay2DOrder(const PointRay2D &p1, const PointRay2D &p2)
Definition: rayprimitives.h:61
A 2D vector class.
Definition: math3d/primitives.h:41
bool LexicalRay3DOrder(const PointRay3D &p1, const PointRay3D &p2)
Definition: rayprimitives.h:81
Contains all definitions in the Geometry package.
Definition: AnyGeometry.cpp:26