Files
qt6-migration-pipeline/external/GeographicLib/share/doc/GeographicLib-dev/example-GeodesicLine3.cpp
T
torsten 77c67c12ca Execute the same instructions but now for tools in folders you are getti
Entire-Metadata: .entire/metadata/fb87247f-2a75-407e-b336-cbc8c20ba5a6
Entire-Session: fb87247f-2a75-407e-b336-cbc8c20ba5a6
Entire-Strategy: manual-commit
2026-09-24 16:24:51 +00:00

29 lines
771 B
C++

// Example of using the Triaxial::GeodesicLine3 class.
#include <iostream>
#include <iomanip>
#include <exception>
#include <GeographicLib/Triaxial/Geodesic3.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
try {
Triaxial::Geodesic3 g(Triaxial::Ellipsoid3::Earth());
Triaxial::GeodesicLine3 l = g.Line(90, 0, 135);
// The approximate distance between opposite umbilical points
double s0 = 20003986;
int num = 20;
for (int i = 0; i <= num; ++i) {
double bet2, omg2, alp2, s12 = i*s0/num;
l.Position(s12, bet2, omg2, alp2);
cout << s12 << " " << bet2 << " " << omg2 << " " << alp2 << "\n";
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}