46 lines
643 B
C
46 lines
643 B
C
#ifndef ELLIPSOID_H__
|
|
#define ELLIPSOID_H__
|
|
|
|
|
|
|
|
#define MATRIX_SIZE 6
|
|
|
|
|
|
typedef struct
|
|
{
|
|
int num; //计算使用的点个数
|
|
float avr[MATRIX_SIZE][MATRIX_SIZE+1]; //平均数矩阵
|
|
float sum[MATRIX_SIZE][MATRIX_SIZE+1]; //和矩阵
|
|
|
|
float a; //x轴半径
|
|
float b; //y轴半径
|
|
float c; //z轴半径
|
|
float x; //x偏移
|
|
float y; //y偏移
|
|
float z; //z偏移
|
|
}ellipsoid_struct;
|
|
|
|
|
|
|
|
|
|
//清零
|
|
void ellipsoid_reset(ellipsoid_struct *ell);
|
|
|
|
//添加点
|
|
void ellipsoid_add_point(ellipsoid_struct *ell,float x,float y,float z);
|
|
|
|
//开始拟合
|
|
void ellipsoid_fitting(ellipsoid_struct *ell);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|