InterviewSolution
| 1. |
What Is The Difference Between A Predicate And A Construction And Why Does This Make A Difference For The Robustness Of My Program? |
|
Answer» Geometric predicates are used to test properties of geometric objects and return, for example, a Boolean value (true or false). An example of PREDICATE would be testing whether a point lies inside a SPHERE is a predicate as is testing whether three points form a left turn, right turn or are collinear. A geometric construction creates a new geometric object, such as the line through TWO different points or the center of a circle defined by a certain SET of points. Constructions are problematic with respect to robustness since the constructed object has to be stored in a particular representation. If this representation does not capture the object's properties sufficiently, due, for example, to limited precision round offs, the correctness of subsequent computations with this object cannot be guaranteed. However, providing EXACT constructions is currently less efficient, which is basically the reason why the kernel CGAL::Exact_predicates_inexact_constructions_kernel exists; double is used as the representation type in this case. Geometric predicates are used to test properties of geometric objects and return, for example, a Boolean value (true or false). An example of predicate would be testing whether a point lies inside a sphere is a predicate as is testing whether three points form a left turn, right turn or are collinear. A geometric construction creates a new geometric object, such as the line through two different points or the center of a circle defined by a certain set of points. Constructions are problematic with respect to robustness since the constructed object has to be stored in a particular representation. If this representation does not capture the object's properties sufficiently, due, for example, to limited precision round offs, the correctness of subsequent computations with this object cannot be guaranteed. However, providing exact constructions is currently less efficient, which is basically the reason why the kernel CGAL::Exact_predicates_inexact_constructions_kernel exists; double is used as the representation type in this case. |
|