#include #include #include int findCAngle (float eg, float ee, float *thc) { /* eg: incoming gamma ray energy */ /* ee: interaction energy (energy deposited in crystal) */ /* declarations */ float egp, cosa; /* calc compton angle */ egp = eg - ee; cosa = 1. + 0.511 / eg - 0.511 / egp; if (cosa > 1) cosa = 1; if (cosa < -1) cosa = -1; *thc = (float) acos (cosa); #if(0) printf ("findCAngle: eg %f, ee %f, *thc %f\n", eg, ee, *thc); #endif /* done */ return (0); }