mirror of https://github.com/CGAL/cgal
PCA: update examples
This commit is contained in:
parent
89bc9db048
commit
72195c2d09
|
|
@ -7,26 +7,26 @@
|
|||
|
||||
typedef double FT;
|
||||
typedef CGAL::Cartesian<FT> K;
|
||||
typedef K::Line_2 Line_2;
|
||||
typedef K::Point_2 Point_2;
|
||||
typedef K::Iso_rectangle_2 Iso_rectangle_2;
|
||||
typedef K::Line_2 Line;
|
||||
typedef K::Point_2 Point;
|
||||
typedef K::Iso_rectangle_2 Iso_rectangle;
|
||||
|
||||
int main()
|
||||
{
|
||||
std::list<Iso_rectangle_2> Iso_rectangles;
|
||||
Iso_rectangles.push_back(Iso_rectangle_2(Point_2(0.0,0.0),Point_2(4.0,8.0)));
|
||||
Iso_rectangles.push_back(Iso_rectangle_2(Point_2(4.0,8.0),Point_2(0.0,16.0)));
|
||||
std::list<Iso_rectangle> rectangles;
|
||||
rectangles.push_back(Iso_rectangle(Point(0.0,0.0),Point(4.0,8.0)));
|
||||
rectangles.push_back(Iso_rectangle(Point(4.0,8.0),Point(0.0,16.0)));
|
||||
|
||||
Line_2 line;
|
||||
Line line;
|
||||
|
||||
// fit whole rectangles
|
||||
linear_least_squares_fitting_2(Iso_rectangles.begin(),Iso_rectangles.end(),line,CGAL::Dimension_tag<2>());
|
||||
linear_least_squares_fitting_2(rectangles.begin(),rectangles.end(),line,CGAL::Dimension_tag<2>());
|
||||
|
||||
// fit rectangle edges
|
||||
linear_least_squares_fitting_2(Iso_rectangles.begin(),Iso_rectangles.end(),line,CGAL::Dimension_tag<1>());
|
||||
linear_least_squares_fitting_2(rectangles.begin(),rectangles.end(),line,CGAL::Dimension_tag<1>());
|
||||
|
||||
// fit rectangle vertices
|
||||
linear_least_squares_fitting_2(Iso_rectangles.begin(),Iso_rectangles.end(),line,CGAL::Dimension_tag<0>());
|
||||
linear_least_squares_fitting_2(rectangles.begin(),rectangles.end(),line,CGAL::Dimension_tag<0>());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Example program for the linear_least_square_fitting function on set of 3D triangles
|
||||
// Example program for the linear_least_square_fitting function
|
||||
// on a set of 3D triangles
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/linear_least_squares_fitting_3.h>
|
||||
#include <list>
|
||||
|
|
|
|||
Loading…
Reference in New Issue