#include <CGAL/predicates_on_points_3.h>
|
| |||
returns CGAL_POSITIVE, if lies on the positive side of the oriented plane defined by , , and , returns CGAL_NEGATIVE if lies on the negative side of , and returns CGAL_COPLANAR if lies on . | ||||
|
| |||
returns true, if , , , and are coplanar. | ||||
|
| |||
returns true, if , , and are collinear. |
Analogously to the two-dimensional case, there are some additional tests for special cases of collinearity. If we not only want to know if three points are collinear but also if they respect a certain order on the line, these are the functions to call:
|
| |||
returns true, iff the three points are collinear and q lies between p and r. Note that true is returned, if q==p or q==r. | ||||
|
| |||
returns true, iff the three points are collinear and q lies strictly between p and r. Note that false is returned, if q==p or q==r. |
If we already know that three points are collinear, we should not check it again (as it is an expensive operation).
|
| |||
returns true, iff q lies between p and
r. Precondition: p, q and r are collinear. | ||||
|
| |||
returns true, iff q lies strictly between p
and r. Precondition: p, q and r are collinear. |
|
| |||
returns the relative position of point test to the sphere
defined by , , , and
. The order of the points ,
, , and does not matter.
Precondition: p, q, r and s are not coplanar. | ||||
|
| |||
returns the relative position of point test to the oriented
sphere defined by , ,
and . The order of the points ,
, , and is important,
since it determines the orientation of the implicitly constructed
sphere. If the points , ,
and are positive oriented, positive
side is the bounded interior of the sphere.
Precondition: p, q, r and s are not coplanar. |
In order to check if two points have the same , , or coordinate we provide the following functions. They allow to write code that does not depend on the representation type.
#include <CGAL/predicates_on_points_3.h>
|
| |
returns true, iff p and q have the same x-coordinate. | ||
|
| |
returns true, iff p and q have the same y-coordinate. | ||
|
| |
returns true, iff p and q have the same z-coordinate. |
The above functions, returning a bool, are decision versions of the following comparison functions, returning a CGAL_Comparison_result.
| ||
| ||
| ||
| ||
| ||
|
For lexicographical comparison CGAL provides
| ||||
| ||||
Compares the Cartesian coordinates of points p and q lexicographically in order: first -coordinates are compared, if they are equal, -coordinates are compared, and if both - and - coordinate are equal, -coordinates are compared. |
In addition, CGAL provides the following comparison functions returning true or false depending on the result of CGAL_compare_lexicographically_xyz(p,q).
|
| |||
|
|