You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
478 B

/*
polynomial fitting class, originally written by Siddharth Bharat Purohit
re-written for ArduPilot by Andrew Tridgell
This fits a polynomial of a given order to a set of data, running as
an online algorithm with minimal storage
*/
#pragma once
#include <stdint.h>
template <uint8_t order>
class PolyFit {
public:
void update(float x, float y);
bool get_polynomial(float res[order]) const;
private:
double mat[order][order];
double vec[order];
};