2 ***********************************************************
3 $SNARK_Header: S N A R K 1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4 $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/geom.cpp $
5 $LastChangedRevision: 85 $
6 $Date: 2014-07-02 16:07:08 -0400 (Wed, 02 Jul 2014) $
8 ***********************************************************
20 Geometry_class GeoPar;
22 Geometry_class::Geometry_class()
35 // rebinf = FALSE; // bug 151 - swr - 08/07/2005
36 lino = FALSE; /// bug #135. Lajos, 08/01/2005
42 for (int i = 1; i < 13; i++)
49 COMPUTE THE NUMBER OF RAYS NECESSARY TO SPAN AN SQUARE OBJECT
50 MELEN*ZISXIP UNITS ON A SIDE
53 INTEGER Geometry_class::numray(INTEGER melen, REAL zisxip)
60 diag = (REAL) (melen * zisxip / 1.414);
68 numb = (INTEGER) (2.0 * pmin);
70 numb = (INTEGER) (2.0 * 1.414 * pmin);
74 xleg = (radius / pinc) * (radius / pinc) - pmin * pmin;
75 if (xleg <= Consts.zero)
79 "\n **** source to origin distance is %10.4f it must be at least %10.4f",
81 fprintf(output, "\n **** program aborted\n");
85 xleg = (REAL) sqrt(xleg);
87 numb = (INTEGER) (2.0 * stod * pmin / (xleg * pinc));
89 numb = (INTEGER) (2.0 * stod * atan2(pmin, xleg) / pinc);
92 return numb + (numb + 1) % 2 + 2;
95 void Geometry_class::print(char *comment)
97 fprintf(output, "\n%s\n", comment);
98 fprintf(output, "prjnum=%d, pinc=%f, nrays=%d, midray=%d, snrays=%d ", prjnum, pinc, nrays, midray, snrays);
99 fprintf(output, "usrays=%d, fsnray=%d, lsnray=%d, fusray=%d, lusray=%d\n", usrays, fsnray, lsnray, fusray, lusray);
100 fprintf(output, "div=%d, tang=%d, arc=%d, radius=%f, stod=%f ", div, tang, arc, radius, stod);
101 fprintf(output, "par=%d, uni=%d, vri=%d, strip=%d, line=%d, lino=%d\n", par, uni, vri, strip, line, lino); // bug 151 - swr - 08/07/2005
102 fprintf(output, "aveden=%f nave2=%d naper=[%d", aveden, nave2, naper[0]);
103 for (int i = 1; i < 13; i++)
104 fprintf(output, ",%d", naper[i]);
105 fprintf(output, "]\n");