Introduction | Files | Utilities | Gallery | ToDo list

slap.h

Go to the documentation of this file.
00001 00003 /* Desc: Small Linear Algrebra Package (SLAP) */ 00004 /* Author: Andrew Howard */ 00005 /* Date: Sun Dec 12 15:22:13 2004 */ 00006 /* Code generated by slap.py */ 00007 #ifndef SLAP_H 00008 #define SLAP_H 00009 00010 #if defined __cplusplus 00011 extern "C" { 00012 #endif 00013 00014 00016 typedef struct 00017 { 00018 double x; 00019 double y; 00020 } vector2_t; 00021 00022 #define VECTOR2 00023 00024 00025 00027 typedef struct 00028 { 00029 double x; 00030 double y; 00031 double z; 00032 } vector3_t; 00033 00034 #define VECTOR3 00035 00036 00037 00039 typedef struct 00040 { 00041 double x; 00042 double y; 00043 double z; 00044 double w; 00045 } vector4_t; 00046 00047 #define VECTOR4 00048 00049 00050 00052 typedef struct 00053 { 00054 double m[3][3]; 00055 } matrix33_t; 00056 00057 #define MATRIX33 00058 00059 00060 00062 typedef struct 00063 { 00064 double m[4][4]; 00065 } matrix44_t; 00066 00067 #define MATRIX44 00068 00069 00070 00072 typedef struct 00073 { 00074 vector2_t pos; 00075 double rot; 00076 } pose2_t; 00077 00078 00079 00081 vector2_t vector2_set(double v0, double v1); 00082 00084 vector2_t vector2_add(vector2_t a, vector2_t b); 00085 00087 vector2_t vector2_sub(vector2_t a, vector2_t b); 00088 00090 vector2_t vector2_unit(vector2_t a); 00091 00093 vector2_t vector2_scale(double a, vector2_t b); 00094 00096 double vector2_dot(vector2_t a, vector2_t b); 00097 00098 00100 double vector2_mag(vector2_t a); 00101 00103 double vector2_dist(vector2_t a, vector2_t b); 00104 00105 00106 00108 vector3_t vector3_set(double v0, double v1, double v2); 00109 00111 vector3_t vector3_add(vector3_t a, vector3_t b); 00112 00114 vector3_t vector3_sub(vector3_t a, vector3_t b); 00115 00117 vector3_t vector3_unit(vector3_t a); 00118 00120 vector3_t vector3_scale(double a, vector3_t b); 00121 00123 double vector3_dot(vector3_t a, vector3_t b); 00124 00126 vector3_t vector3_cross(vector3_t a, vector3_t b); 00127 00129 double vector3_mag(vector3_t a); 00130 00132 double vector3_dist(vector3_t a, vector3_t b); 00133 00134 00135 00137 vector4_t vector4_set(double v0, double v1, double v2, double v3); 00138 00140 vector4_t vector4_add(vector4_t a, vector4_t b); 00141 00143 vector4_t vector4_sub(vector4_t a, vector4_t b); 00144 00146 vector4_t vector4_unit(vector4_t a); 00147 00149 vector4_t vector4_scale(double a, vector4_t b); 00150 00152 double vector4_dot(vector4_t a, vector4_t b); 00153 00154 00156 double vector4_mag(vector4_t a); 00157 00159 double vector4_dist(vector4_t a, vector4_t b); 00160 00161 00162 00164 matrix33_t matrix33_set(double v00, double v01, double v02, double v10, double v11, double v12, double v20, double v21, double v22); 00165 00167 matrix33_t matrix33_setv(double v[16]); 00168 00170 matrix33_t matrix33_ident(); 00171 00173 matrix33_t matrix33_add(matrix33_t a, matrix33_t b); 00174 00176 matrix33_t matrix33_sub(matrix33_t a, matrix33_t b); 00177 00179 matrix33_t matrix33_mul(matrix33_t a, matrix33_t b); 00180 00181 #if defined VECTOR3 00182 00183 vector3_t matrix33_mul_3(matrix33_t a, vector3_t b); 00184 #endif 00185 00186 #if defined MATRIX33 00187 00188 matrix33_t matrix33_trans(matrix33_t a); 00189 #endif 00190 00192 matrix33_t matrix33_inv(matrix33_t a); 00193 00195 int matrix33_isnan(matrix33_t a); 00196 00197 #if defined MATRIX31 && defined MATRIX31 00198 00199 matrix31_t matrix33_mul_31(matrix33_t a, matrix31_t b); 00200 #endif 00201 00202 #if defined MATRIX32 && defined MATRIX32 00203 00204 matrix32_t matrix33_mul_32(matrix33_t a, matrix32_t b); 00205 #endif 00206 00207 #if defined MATRIX33 && defined MATRIX33 00208 00209 matrix33_t matrix33_mul_33(matrix33_t a, matrix33_t b); 00210 #endif 00211 00212 00213 00215 matrix44_t matrix44_set(double v00, double v01, double v02, double v03, double v10, double v11, double v12, double v13, double v20, double v21, double v22, double v23, double v30, double v31, double v32, double v33); 00216 00218 matrix44_t matrix44_setv(double v[16]); 00219 00221 matrix44_t matrix44_ident(); 00222 00224 matrix44_t matrix44_add(matrix44_t a, matrix44_t b); 00225 00227 matrix44_t matrix44_sub(matrix44_t a, matrix44_t b); 00228 00230 matrix44_t matrix44_mul(matrix44_t a, matrix44_t b); 00231 00232 #if defined VECTOR4 00233 00234 vector4_t matrix44_mul_4(matrix44_t a, vector4_t b); 00235 #endif 00236 00237 #if defined MATRIX44 00238 00239 matrix44_t matrix44_trans(matrix44_t a); 00240 #endif 00241 00243 matrix44_t matrix44_inv(matrix44_t a); 00244 00246 int matrix44_isnan(matrix44_t a); 00247 00248 #if defined MATRIX41 && defined MATRIX41 00249 00250 matrix41_t matrix44_mul_41(matrix44_t a, matrix41_t b); 00251 #endif 00252 00253 #if defined MATRIX42 && defined MATRIX42 00254 00255 matrix42_t matrix44_mul_42(matrix44_t a, matrix42_t b); 00256 #endif 00257 00258 #if defined MATRIX43 && defined MATRIX43 00259 00260 matrix43_t matrix44_mul_43(matrix44_t a, matrix43_t b); 00261 #endif 00262 00263 #if defined MATRIX44 && defined MATRIX44 00264 00265 matrix44_t matrix44_mul_44(matrix44_t a, matrix44_t b); 00266 #endif 00267 00268 00269 00271 pose2_t pose2_set(vector2_t pos, double rot); 00272 00274 pose2_t pose2_inv(pose2_t a); 00275 00277 pose2_t pose2_add(pose2_t a, pose2_t b); 00278 00280 vector2_t pose2_add_pos(vector2_t a, pose2_t b); 00281 00283 double pose2_add_rot(double a, pose2_t b); 00284 00286 pose2_t pose2_sub(pose2_t a, pose2_t b); 00287 00289 vector2_t pose2_sub_pos(vector2_t a, pose2_t b); 00290 00292 double pose2_sub_rot(double a, pose2_t b); 00293 00294 00295 00296 #if defined __cplusplus 00297 } 00298 #endif 00299 00300 #endif

Generated on Tue Dec 14 14:37:39 2004 for Simple map utilities by doxygen 1.3.8