12 namespace GeographicLib {
20 _earth.Forward(_lat0, _lon0, _h0, _x0, _y0, _z0);
22 phi = lat0 * Math::degree<real>(),
24 cphi = abs(_lat0) == 90 ? 0 : cos(phi),
25 lam = lon0 * Math::degree<real>(),
26 slam = _lon0 == -180 ? 0 : sin(lam),
27 clam = abs(_lon0) == 90 ? 0 : cos(lam);
28 _earth.Rotation(sphi, cphi, slam, clam, _r);
31 void LocalCartesian::MatrixMultiply(
real M[dim2_])
const throw() {
33 copy(M, M + dim2_, t);
34 for (
size_t i = 0; i < dim2_; ++i) {
35 size_t row = i / dim_, col = i % dim_;
36 M[i] = _r[row] * t[col] + _r[row+3] * t[col+3] + _r[row+6] * t[col+6];
40 void LocalCartesian::IntForward(
real lat,
real lon,
real h,
42 real M[dim2_])
const throw() {
44 _earth.IntForward(lat, lon, h, xc, yc, zc, M);
45 xc -= _x0; yc -= _y0; zc -= _z0;
46 x = _r[0] * xc + _r[3] * yc + _r[6] * zc;
47 y = _r[1] * xc + _r[4] * yc + _r[7] * zc;
48 z = _r[2] * xc + _r[5] * yc + _r[8] * zc;
55 real M[dim2_])
const throw() {
57 xc = _x0 + _r[0] * x + _r[1] * y + _r[2] * z,
58 yc = _y0 + _r[3] * x + _r[4] * y + _r[5] * z,
59 zc = _z0 + _r[6] * x + _r[7] * y + _r[8] * z;
60 _earth.IntReverse(xc, yc, zc, lat, lon, h, M);
static T AngNormalize(T x)
void Reset(real lat0, real lon0, real h0=0)
Header for GeographicLib::LocalCartesian class.
GeographicLib::Math::real real