return offset in meters
Definition at line 45 of file offset.cc.
References sff::SRCE::cs, sff::INFO::cs, CS_cartesian, CS_spherical, sff::SRCE::cx, sff::INFO::cx, sff::SRCE::cy, sff::INFO::cy, SFF_abort, and SFF_assert.
Referenced by offsetdeg().
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!");
#define SFF_assert(C, M)
check condition
#define SFF_abort(M)
abort by throwing an exception