#include #include /* Note: 1. please keep the variables in the two lines at the beginning visible by the following two functions. (maybe including them into a header file.) 2. now, lookup_maxh(period) and lookup_minh(period) will putout the largest and the smallest h respectively. 3. real data in: ((0.0 0.0 0.0) --- (54.0 33.0 -45.0). (x,y,z) --- (km,km,km). ((17.0,12.0,0.0) --- (37.0,22.0,-1.0) */ double lookup_minh(double period) { double v, fact; v = 1.0; fact=10.0; return (double) (v*period/fact); } double lookup_maxh(double period) { double v, fact; v = 3.0; fact=10.0; return (double) (v*period/fact); } double lookup_h(double x, double y, double z, double period) { double v1, v2, d, x_bound, fact; double h; v1 = 1.0; v2 = 3.0; d = -1.0; x_bound = 9.0; fact=10.0; if ((z > d) && (x > x_bound)) h = (double) (v1*period/fact); else h = (double) (v2*period/fact); return h; }