File: example-AuxAngle.cpp

package info (click to toggle)
geographiclib 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,572 kB
  • sloc: cpp: 27,765; sh: 5,463; makefile: 695; python: 12; ansic: 10
file content (24 lines) | stat: -rw-r--r-- 673 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Example of using the GeographicLib::AuxAngle class.

#include <iostream>
#include <iomanip>
#include <exception>
#include <GeographicLib/AuxAngle.hpp>

int main(int argc, const char* const argv[]) {
  try {
    using angle = GeographicLib::AuxAngle;
    // Print table of parametric latitudes for f = 0.5
    double f = 0.5;
    std::cout << std::fixed << std::setprecision(4);
    for (int d = 0; d <= 90; d+=10) {
      angle phi(angle::degrees(d)), beta(phi);
      beta.y() *= (1 - f);
      std::cout << d << " " << beta.degrees() << "\n";
    }
  }
  catch (const std::exception& e) {
    std::cerr << "Caught exception: " << e.what() << "\n";
    return 1;
  }
}