Loading [MathJax]/extensions/TeX/AMSsymbols.js
CGAL Version:
master
6.0.1
latest
5.6.2
5.5.5
5.4.5
5.3.2
5.2.4
5.1.5
5.0.4
4.14.3
4.13.2
4.12.2
4.11.3
4.10.2
4.9.1
4.8.2
4.7
4.6.3
4.5.2
4.4
4.3
5.4.1
cgal.org
Top
Getting Started
Tutorials
Package Overview
Acknowledging CGAL
CGAL 5.4.1 - 2D and 3D Linear Geometry Kernel
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Kernel_23/surprising.cpp
#include <iostream>
#include <CGAL/Simple_cartesian.h>
typedef
CGAL::Simple_cartesian<double>
Kernel
;
typedef
Kernel::Point_2
Point_2;
int
main()
{
{
Point_2 p(0, 0.3), q(1, 0.6), r(2, 0.9);
std::cout << (
CGAL::collinear
(p,q,r) ?
"collinear\n"
:
"not collinear\n"
);
}
{
Point_2 p(0, 1.0/3.0), q(1, 2.0/3.0), r(2, 1);
std::cout << (
CGAL::collinear
(p,q,r) ?
"collinear\n"
:
"not collinear\n"
);
}
{
Point_2 p(0,0), q(1, 1), r(2, 2);
std::cout << (
CGAL::collinear
(p,q,r) ?
"collinear\n"
:
"not collinear\n"
);
}
return
0;
}