00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00035 #ifndef _VECT2_H_
00036 #define _VECT2_H_
00037
00039 typedef double Real;
00040
00041 #define TO_RAD(x) (((double)x)*(M_PI/180.0))
00042 #define TO_DEG(x) (((double)x)*(180.0/M_PI))
00043
00046 typedef struct _vect2_cart
00047 {
00048 Real x;
00049 Real y;
00050
00051 }vect2_cart;
00052
00053
00056 typedef struct _vect2_pol
00057 {
00058 Real r;
00059 Real theta;
00060
00061 }vect2_pol;
00062
00063
00064
00076 void vect2_pol2cart(vect2_pol* vp, vect2_cart* vc);
00077
00078
00085 void vect2_cart2pol(vect2_cart* vc, vect2_pol* vp);
00086
00106 void vect2_add_pol(vect2_pol* v1, vect2_pol* v2, vect2_pol* vresult);
00107
00108
00117 void vect2_add_cart(vect2_cart* v1, vect2_cart* v2, vect2_cart* vresult);
00118
00119
00132 void vect2_sub_pol(vect2_pol* v1, vect2_pol* v2, vect2_pol* vresult);
00133
00142 void vect2_sub_cart(vect2_cart* v1, vect2_cart* v2, vect2_cart* vresult);
00143
00144
00153 void vect2_scale_cart(vect2_cart* v1, Real alpha, vect2_cart* vresult);
00154
00163 void vect2_scale_pol(vect2_pol* v1, Real alpha, vect2_pol* vresult);
00164
00168 #endif