-1
+
演算子を使用してCGALに2つのポイントを追加しようとしています。なぜ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;
。私はドキュメントを読み違えた
/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;
~~~~~~~~~~~~~~^~~~~~~~~~~~
あなたは関数の内部で、あなたの 'のstd :: cout'statementsを配置する必要があります:ドキュメントから(どのもちろん、完全に理にかなって)
。おそらく 'int main()'ですか? – Galik
数学的には正しくありません。 'Vector_2'は有効です。 – sloriot
たぶん私はそれを紛失していますが、ドキュメンテーションのどこで2つのポイントを追加できますか?数学的には、これは許されるべきではありません。 – templatetypedef