-1
+
연산자를 사용하여 CGAL에서 두 점을 추가하려고합니다.CGAL에서 포인트를 추가 할 수없는 이유
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Point_2.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_2 Point;
using namespace std;
cout << Point(8.9, 9) + Point(1,1) << endl;
cout << Point(8.9, 9) + Point(2,2) * .5 << endl;
나는 documentation을 고려하여 가능한 것으로 가정합니다. 나는이 문서를 오독했다
/path_to_file/main.cpp:25: error: no match for ‘operator+’ (operand types are ‘Point {aka CGAL::Point_2<CGAL::Simple_cartesian<double> >}’ and ‘Point {aka CGAL::Point_2<CGAL::Simple_cartesian<double> >}’)
cout << Point(8.9, 9) + Point(1,1) << endl;
~~~~~~~~~~~~~~^~~~~~~~~~~~
당신은 함수 내부에'표준 : cout'statements을 넣어해야합니다. 어쩌면'int main()'? – Galik
수학적으로 정확하지 않습니다. 'Vector_2 '를 사용하면 유효합니다. – sloriot
어쩌면 나는 그것을 놓치고 있지만, 문서에서 두 점을 더할 수 있다고 말하는 곳은 어디입니까? 수학적으로 허용해서는 안됩니다. – templatetypedef