#ifndef YSCALC
#define YSCALC

typedef struct {
	double x,y,z;
} DPOINT;

typedef struct {
	double h,p,b;
} DANGLE;

typedef struct {
	double sh,ch,sp,cp,sb,cb;
} DTRIGON;

typedef struct {
	DPOINT bas;
	DPOINT vec;
} DPLANE;

typedef struct {
	DPOINT p;
	DANGLE a;
} DPNTANG;

typedef struct {
	DPOINT bas;
	DPOINT vec;	
} DLINE;

typedef struct {
	DPOINT org;
	DANGLE an;
	DTRIGON tr;
} DAXIS;



/*                                       */
/*                                       */
/*      Machine Independent Sources      */
/*                                       */
/*                                       */
/* calc.c */
void AddDpoint(DPOINT *dst,DPOINT *a,DPOINT *b);
void Bezier(DPOINT *p,int n,DPOINT *bz,double t);
void ConvertLaxToGax(DPOINT *dst,DPOINT *src,DAXIS *axs);
void ConvertGaxToLax(DPOINT *dst,DPOINT *src,DAXIS *axs);
int CrossPoint(DPOINT *out,DLINE *ln,DPLANE *pl);
void DangleToDvector(DPOINT *e,DPOINT *u,DANGLE *a);
void DaxisToDplane(DPLANE *dst,DAXIS *src);
void DivDpoint(DPOINT *dst,DPOINT *src,double dv);
void DvectorToDangle(DANGLE *a,DPOINT *e,DPOINT *v);
void GetCurveDpoint(DPOINT *r,DPOINT p[3],double t);
double InnerProduct(DPOINT *v1,DPOINT *v2);
void InterpolateDangle(DANGLE *o,DANGLE *a1,DANGLE *a2,double a,double b);
void InterpolateDpoint(DPOINT *p,DPOINT *p1,DPOINT *p2,double a,double b);
void InterpolateDvector(DPOINT *o,DPOINT *p1,DPOINT *p2,double a,double b);
void LineProjectionVector(DPOINT *p1,DPOINT *p2,DPOINT *p3,DPOINT *v);
void MakeDtrigonomy(DTRIGON *tr,DANGLE *an);
void MakeDaxis(DAXIS *axs,DPOINT *org,DANGLE *an);
void MakeDplane(DPLANE *pln,int n,DPOINT *pnt);
void MulDpoint(DPOINT *dst,DPOINT *src,double ml);
void OuterProduct(DPOINT *vo,DPOINT *v1,DPOINT *v2);
void Pitching(DANGLE *d,DANGLE *s,double an);
void PlaneProjection(DPLANE *pln,DPOINT *pnt);
void Rotate(double *x,double *y,double an);
void RotateQuick(double *x,double *y,double s,double c);
void RotateGtoL(DPOINT *p,DANGLE *an);
void RotateGtoLQuick(DPOINT *p,DTRIGON *an);
void RotateLtoG(DPOINT *p,DANGLE *an);
void RotateLtoGQuick(DPOINT *p,DTRIGON *an);
void SetDangleRad(DANGLE *dst,double h,double p,double b);
void SetDangleDeg(DANGLE *dst,double h,double p,double b);
void SetDpoint(DPOINT *dst,double x,double y,double z);
void SubDpoint(DPOINT *dst,DPOINT *a,DPOINT *b);
double VectorLength(DPOINT *vec);
void VectorNormalize(DPOINT *vec);
void Yawing(DANGLE *d,DANGLE *s,double an);


#endif /* #ifndef YSCALC */
