00001
00013 #ifndef BPMORBIT_H__
00014 #define BPMORBIT_H__
00015
00016
00017
00018
00019 #include <math.h>
00020 #include <bpm/bpm_defs.h>
00021 #include <bpm/bpm_units.h>
00022 #include <bpm/bpm_interface.h>
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00039 struct v3 {
00040 double x;
00041 double y;
00042 double z;
00043 };
00044
00049 struct m33 {
00050 double e[3][3];
00051 };
00052
00053
00054
00055
00056
00057
00058
00067 EXTERN double get_rbend( double e, double B, double l, double p );
00068
00069
00078 EXTERN double get_sbend( double e, double B, double l, double p );
00079
00080
00086 EXTERN int get_bpmhit( bunchconf_t* bunch, bpmconf_t* bpm );
00087
00088
00094 EXTERN int get_bpmhits( beamconf_t* beam, bpmconf_t* bpm );
00095
00096
00098 void v_copy(struct v3 *v1, struct v3 *v2);
00099
00101 double v_mag(struct v3 *v1);
00102
00104 void v_scale(struct v3 *v1, double dscale);
00105
00107 void v_norm(struct v3 *v1);
00108
00110 void v_matmult(struct m33 *m1, struct v3 *v1);
00111
00113 void v_add(struct v3 *v1, struct v3 *v2);
00114
00116 void v_sub(struct v3 *v1, struct v3 *v2);
00117
00119 double v_dot(struct v3 *v1, struct v3 *v2);
00120
00122 void v_cross(struct v3 *v1, struct v3 *v2);
00123
00125 void v_print(struct v3 *v1);
00126
00128 void m_rotmat(struct m33 *m1, double alpha, double beta, double gamma);
00129
00131 void m_matmult(struct m33 *m, struct m33 *m1, struct m33 *m2);
00132
00134 void m_matadd(struct m33 *m1, struct m33 *m2);
00135
00137 void m_print(struct m33 *m1);
00138
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142
00143 #endif
00144
00145