CGAL 6.1.1 - 2D and 3D Linear Geometry Kernel

Loading...
Searching...
No Matches
Kernel_23/exact.cpp
#include <iostream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <sstream>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
int main()
{
Point_2 p(0, 0.3), q, r(2, 0.9);
{
q = Point_2(1, 0.6);
std::cout << (CGAL::collinear(p,q,r) ? "collinear\n" : "not collinear\n");
}
{
std::istringstream input("0 0.3 1 0.6 2 0.9");
input >> p >> q >> r;
std::cout << (CGAL::collinear(p,q,r) ? "collinear\n" : "not collinear\n");
}
{
q = CGAL::midpoint(p,r);
std::cout << (CGAL::collinear(p,q,r) ? "collinear\n" : "not collinear\n");
}
return 0;
}
CGAL::Exact_predicates_exact_constructions_kernel
A typedef to a kernel which has the following properties:
Definition: Exact_predicates_exact_constructions_kernel.h:27
Kernel::Point_2
A type representing points in two dimensions.
Definition: GeomObjects.h:414
CGAL::midpoint
Point_d< R > midpoint(const Point_d< R > &p, const Point_d< R > &q)
CGAL::collinear
bool collinear(const CGAL::Point_2< Kernel > &p, const CGAL::Point_2< Kernel > &q, const CGAL::Point_2< Kernel > &r)
returns true, iff p, q, and r are collinear.
Kernel
Definition: FunctionObjectConcepts.h:2