#include <iostream>

using namespace std;

#include "../lens_distortion.h"       /* Functions code associated to amy_prototypes.h */
#include "../point2d.h"

int main()
{
    std::vector<double> l1r;
    ami::point2d<double> dc;
    double max_distance_corner=500.;
    int Na=4;
    double *a;
    a=(double*) malloc(5*sizeof(double));
    a[0]=7.279240757781450e-001;
    a[1] = 0.;
    a[2] = 2.662468351945994e-006;
    a[3] = 0.;
    a[4] = -4.416661695504918e-013;

    int result=build_l1r_vector(l1r,dc,max_distance_corner,Na,a);

    for(int k=0;k<300;k++){
      double x=2*k,y=k;
      double xc=300,yc=300;
      double xt,yt;
      double dist=ami_inverse_lens_distortion_newton_raphson(x,y,xc,yc,&xt,&yt,a,Na);
    }


    free(a);

    cout << "Hello world!" << endl;
    return 0;
}
