#ifndef M_PI # define M_PI 3.14159265358979323846 # define M_PI_2 1.57079632679489661923 # define M_PI_4 0.78539816339744830962 # define M_1_PI 0.31830988618379067154 # define M_2_PI 0.63661977236758134308 # define M_2_SQRTPI 1.12837916709551257390 #endif #define _2_M_PI 6.2831853072 #define Float float typedef Float Point3D[3]; typedef Float Matriz[4][4]; #define COS(x) ((Float)cos((double)(x))) #define SIN(x) ((Float)sin((double)(x))) #define RADS(a) ((Float)((a)*M_PI/180.0)) #define DEGS(a) ((Float)((a)*180.0/M_PI)) #define eje_x 1.0,0.0,0.0 #define eje_y 0.0,1.0,0.0 #define eje_z 0.0,0.0,1.0 typedef struct { Float Radio, /* >= 0 */ Lat, /* 0 <= Lat < 2*PI */ Long; /* 0 <= Long < PI */ } PEsf; typedef Float Matriz2D[3][2]; typedef Float Point4D[4]; extern Float ModV(Point3D vect); extern void NormV(Point3D vect_i, Point3D vect_o); extern void CopV(Point3D vect_i, Point3D vect_o); extern void SumV(Point3D vect_1,Point3D vect_2,Point3D vect_o); extern void ResV(Point3D vect_1,Point3D vect_2,Point3D vect_o); extern void ProdvV(Point3D vect_1,Point3D vect_2,Point3D vect_o); extern Float ProdeV(Point3D vect_1,Point3D vect_2); extern void ConsV(Float k,Point3D vect_i,Point3D vect_o); extern Float AngrV(Point3D vect_1,Point3D vect_2); extern Float AnggV(Point3D vect_1,Point3D vect_2); extern Float DistV(Point3D vect_1,Point3D vect_2); extern void printfV(int id,Point3D vect); extern void PEsfAV(PEsf *pesfi,Point3D vecto); extern void VAPEsf( Point3D vecti, PEsf *pesfo ); extern int Identity3D(Matriz M); extern int Translate3D(Float Tx, Float Ty, Float Tz, Matriz M); extern int Rotate3D( char Axis, /* axis about which to rotate */ Float Angle, /* how much to rotate */ Matriz M /* return matrix */ ); extern void ProdM3DV( Matriz M, Point3D V, Float D4th, Point3D Result ); extern void ProdM4DV( Matriz M, Point4D V, Point4D Result ); extern void ProdM3DM( Matriz Mio, Matriz M ); extern int Identity2D(Matriz2D M); extern int Scale2D(Matriz2D M, Float Sx, Float Sy); extern int Translate2D(Matriz2D M, Float Tx, Float Ty); extern int Rotate2D(Matriz2D M, Float Theta); extern int Shear2D(Matriz2D M, Float Sx, Float Sy); extern int Scale3D(Float Sx, Float Sy, Float Sz, Matriz M); /*************************************************************************/ extern Point3D ElEjeDeGiro; #define EJE_GIRO ElEjeDeGiro[0], ElEjeDeGiro[1], ElEjeDeGiro[2]