#include <stdlib.h>

#include "tree.h"
#include "readpts.h"
#include "t_est.h"
#include "test.h"

#define max(a,b) ((a>b)?a:b)

int main(int argc,
	 char *argv[]
	 )
{
  coord *points=NULL;
  int n=0;
  double a;
  double b;
  double h;

  if(argc <= 1){
    fprintf(stderr,"There was no specified input!\n");
    return 1;
  }

  points=readpoints(argv[1],&a,&b,&n,points);
  if(points==NULL){
    fprintf(stderr,"Failed to read file %s",argv[1]);
    exit(1);
  }

  for(h=0.001; h < max(a,b)/2; h+=0.001){
    printf("%.8e\n",t_tor(points,n,a,b,h));
  }
  return 0.0;
}
    
