Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A lightweight C++ library for fitting polynomial surfaces to 3D point data. Uses Eigen for efficient linear algebra operations and provides a simple API for fitting and evaluating polynomial surfaces of any degree

License

gbowne1/polyfit2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polyfit2d

License: MIT Build with CMake Language: C++ Platform

polyfit2d is a lightweight, header-based C++17 library for fitting and evaluating 2D polynomial surfaces using least squares. It's built on top of Eigen for matrix operations and provides a clean, simple interface.


✨ Features

  • Fit a polynomial surface of arbitrary degree to 3D data points.
  • Efficient least-squares solver using Eigen.
  • Easy evaluation of the fitted surface at any (x, y) point.
  • Header-only interface.
  • MIT licensed and open source.

📦 Installation

This project uses CMake for configuration and building.

🔧 Dependencies

🔨 Build

git clone https://github.com/gbowne1/polyfit2d.git
cd polyfit2d
mkdir build && cd build
cmake ..
make
./polyfit2d_tests

🧪 Example

Here's a good way to use it

#include <iostream>
#include "polyfit2d/polyfit2d.hpp"

int main() {
    using namespace polyfit2d;

    std::vector<Point3D> points = {
        {0, 0, 1},
        {1, 0, 2},
        {0, 1, 2},
        {1, 1, 3}
    };

    PolynomialSurface surface(1);
    surface.fit(points);

    std::cout << "f(0.5, 0.5) = " << surface.evaluate(0.5, 0.5) << std::endl;

    return 0;
}

📜 License

This project is licensed under the MIT License — see the LICENSE

🤝 Contributing

Contributions, issues and feature requests are welcome!

  • Fork the repository

  • Create your feature branch (git checkout -b feature/some-feature)

  • Commit your changes (git commit -am 'Add new feature')

  • Push to the branch (git push origin feature/some-feature)

  • Create a new Pull Request

About

A lightweight C++ library for fitting polynomial surfaces to 3D point data. Uses Eigen for efficient linear algebra operations and provides a simple API for fitting and evaluating polynomial surfaces of any degree

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published