Shao Rui
/
Kalman
1
defining.h@0:c55310328157, 2020-02-07 (annotated)
- Committer:
- shaorui
- Date:
- Fri Feb 07 11:34:24 2020 +0000
- Revision:
- 0:c55310328157
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shaorui | 0:c55310328157 | 1 | #ifndef __defining__ |
shaorui | 0:c55310328157 | 2 | #define __defining__ |
shaorui | 0:c55310328157 | 3 | |
shaorui | 0:c55310328157 | 4 | /*===============================================================*/ |
shaorui | 0:c55310328157 | 5 | /*define type |
shaorui | 0:c55310328157 | 6 | */ |
shaorui | 0:c55310328157 | 7 | |
shaorui | 0:c55310328157 | 8 | |
shaorui | 0:c55310328157 | 9 | /*bool type*/ |
shaorui | 0:c55310328157 | 10 | enum Bool_{ |
shaorui | 0:c55310328157 | 11 | False=0, |
shaorui | 0:c55310328157 | 12 | True=1, |
shaorui | 0:c55310328157 | 13 | }; |
shaorui | 0:c55310328157 | 14 | typedef enum Bool_ Bool; |
shaorui | 0:c55310328157 | 15 | |
shaorui | 0:c55310328157 | 16 | |
shaorui | 0:c55310328157 | 17 | /*矩阵,向量,四元数*/ |
shaorui | 0:c55310328157 | 18 | typedef double (*Mat3)[3]; |
shaorui | 0:c55310328157 | 19 | typedef double *Vec3,*Quat,*Vec,*Mat,*Point,*Point3; |
shaorui | 0:c55310328157 | 20 | typedef const double (*cMat3)[3]; |
shaorui | 0:c55310328157 | 21 | typedef const double *cVec3,*cQuat,*cVec,*cMat,*cPoint,*cPoint3; |
shaorui | 0:c55310328157 | 22 | typedef int (*nMat3)[3]; |
shaorui | 0:c55310328157 | 23 | typedef int *nVec3,*nQuat,*nVec,*nMat,*nPoint,*nPoint3; |
shaorui | 0:c55310328157 | 24 | typedef const int (*cnMat3)[3]; |
shaorui | 0:c55310328157 | 25 | typedef const int *cnVec3,*cnQuat,*cnVec,*cnMat,*cnPoint,*cnPoint3; |
shaorui | 0:c55310328157 | 26 | /*复数*/ |
shaorui | 0:c55310328157 | 27 | typedef struct Complex_{ |
shaorui | 0:c55310328157 | 28 | double real; |
shaorui | 0:c55310328157 | 29 | double img; |
shaorui | 0:c55310328157 | 30 | }Complex; |
shaorui | 0:c55310328157 | 31 | |
shaorui | 0:c55310328157 | 32 | |
shaorui | 0:c55310328157 | 33 | /*===============================================================*/ |
shaorui | 0:c55310328157 | 34 | /*宏定义 |
shaorui | 0:c55310328157 | 35 | */ |
shaorui | 0:c55310328157 | 36 | #ifndef NULL |
shaorui | 0:c55310328157 | 37 | #define NULL 0 |
shaorui | 0:c55310328157 | 38 | #endif |
shaorui | 0:c55310328157 | 39 | #ifndef MAX_PATH |
shaorui | 0:c55310328157 | 40 | #define MAX_PATH 260 |
shaorui | 0:c55310328157 | 41 | #endif |
shaorui | 0:c55310328157 | 42 | /* |
shaorui | 0:c55310328157 | 43 | #ifndef UNUSED |
shaorui | 0:c55310328157 | 44 | #define UNUSED(x) (x=x) |
shaorui | 0:c55310328157 | 45 | #endif */ |
shaorui | 0:c55310328157 | 46 | #ifndef min |
shaorui | 0:c55310328157 | 47 | #define min(a,b) (((a) < (b)) ? (a) : (b)) |
shaorui | 0:c55310328157 | 48 | #endif |
shaorui | 0:c55310328157 | 49 | #ifndef max |
shaorui | 0:c55310328157 | 50 | #define max(a,b) (((a) > (b)) ? (a) : (b)) |
shaorui | 0:c55310328157 | 51 | #endif |
shaorui | 0:c55310328157 | 52 | #ifndef MGet |
shaorui | 0:c55310328157 | 53 | #define MGet(p,i,j,n) (p[(i)*(n)+(j)]) /*n列矩阵的(i,j)元素*/ |
shaorui | 0:c55310328157 | 54 | #endif |
shaorui | 0:c55310328157 | 55 | |
shaorui | 0:c55310328157 | 56 | |
shaorui | 0:c55310328157 | 57 | /*===============================================================*/ |
shaorui | 0:c55310328157 | 58 | /*数学常数宏 |
shaorui | 0:c55310328157 | 59 | pi - 圆周率 |
shaorui | 0:c55310328157 | 60 | pi2 - pi的两倍 |
shaorui | 0:c55310328157 | 61 | ee - 自然对数底 |
shaorui | 0:c55310328157 | 62 | */ |
shaorui | 0:c55310328157 | 63 | |
shaorui | 0:c55310328157 | 64 | /*创建时间: 20061122 |
shaorui | 0:c55310328157 | 65 | 最近更改时间:20070525 |
shaorui | 0:c55310328157 | 66 | Copyright 2006-2010 SSTC |
shaorui | 0:c55310328157 | 67 | */ |
shaorui | 0:c55310328157 | 68 | #ifndef pi |
shaorui | 0:c55310328157 | 69 | #define pi 3.1415926535897932384626433832795 |
shaorui | 0:c55310328157 | 70 | #endif |
shaorui | 0:c55310328157 | 71 | #ifndef pi2 |
shaorui | 0:c55310328157 | 72 | #define pi2 6.2831853071795864769252867665590 |
shaorui | 0:c55310328157 | 73 | #endif |
shaorui | 0:c55310328157 | 74 | #ifndef ee |
shaorui | 0:c55310328157 | 75 | #define ee 2.7182818284590455348848081484903 |
shaorui | 0:c55310328157 | 76 | #endif |
shaorui | 0:c55310328157 | 77 | |
shaorui | 0:c55310328157 | 78 | |
shaorui | 0:c55310328157 | 79 | |
shaorui | 0:c55310328157 | 80 | #endif |