Skip to content

Instantly share code, notes, and snippets.

@afabri
Created November 25, 2021 07:23
Show Gist options
  • Save afabri/e74d6bbf503c802066a23f194700f4f9 to your computer and use it in GitHub Desktop.
Save afabri/e74d6bbf503c802066a23f194700f4f9 to your computer and use it in GitHub Desktop.
#include <CGAL/Simple_cartesian.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <vector>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Plane_3 Plane;
int main()
{
Point p(1,1,1), q(2,2,2);
Plane plane;
std::vector<Point> points;
points.push_back(p);
points.push_back(q);
FT conf = linear_least_squares_fitting_3(points.begin(), points.end(), plane, CGAL::Dimension_tag<0>());
std::cout << conf << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment