36 #define TF_OFFSET_CC_VERSION \ 50 "ERROR (offset): inconsistent coordinate systems!");
53 const double convfac=0.017453293;
54 double rtet=(90.-info.
cx)*convfac;
55 double stet=(90.-srce.
cx)*convfac;
56 double rphi=info.
cy*convfac;
57 double sphi=srce.
cy*convfac;
58 double cosepi=cos(stet)*cos(rtet)+sin(stet)*sin(rtet)*cos(sphi-rphi);
59 retval=acos(cosepi)*radius*1.e3;
63 double dx=srce.
cx-info.
cx;
64 double dy=srce.
cy-info.
cy;
65 retval=sqrt(dx*dx+dy*dy);
69 SFF_abort(
"ERROR (offset): unknown coordinate system!");
82 "ERROR (sourcedistance): inconsistent coordinate systems!");
84 "ERROR (sourcedistance): " 85 "only provided in Cartesian coordinates!");
88 double dx=srce.
cx-info.
cx;
89 double dy=srce.
cy-info.
cy;
90 double dz=srce.
cz-info.
cz;
91 retval=sqrt(dx*dx+dy*dy+dz*dz);
95 SFF_abort(
"ERROR (sourcedistance): unknown coordinate system!");
104 const double& radius)
106 double retval=
offset(srce, info, radius)*1.e-3*360./(2.*M_PI*radius);
double offsetdeg(const SRCE &srce, const INFO &info, const double &radius)
return offset in degrees
#define SFF_assert(C, M)
check condition
#define SFF_abort(M)
abort by throwing an exception
double offset(const SRCE &srce, const INFO &info, const double &radius)
return offset in meters
double sourcedistance(const SRCE &srce, const INFO &info)
return spatial distance between source and receiver in meters