Files
qt6-migration-pipeline/external/GeographicLib/share/doc/GeographicLib-dev/example-Ellipsoid3.cpp
T
torstenandCopilot 342ffd3e5c Update submodule to latest BUILD_RTI fixes
- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten
- svcTabCommon: Export-Header-Fix via Fallback-Target
- TrainingAreaBase: Stub-Header für BUILD_RTI=OFF
- ddsfts: Include-Pfad und Dependency-Fixes
- BUILD_RTI=OFF Compilation vollständig unterstützt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
2026-08-21 19:30:20 +02:00

35 lines
1023 B
C++

// Example of using the Triaxial::Ellipsoid3 class.
#include <iostream>
#include <iomanip>
#include <exception>
#include <GeographicLib/Triaxial/Ellipsoid3.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
try {
using Triaxial::Ellipsoid3;
using ang = Angle;
using vec3 = Ellipsoid3::vec3;
Ellipsoid3 t(3, 2, 1);
ang bet{40}, omg{20}, alp{80};
vec3 r, v;
t.elliptocart2(bet, omg, alp, r, v);
cout << fixed << setprecision(3)
<< "[bet, omg, alp] = ["
<< double(bet) << " " << double(omg) << " " << double(alp)
<< "]\n => r = [" << r[0] << " " << r[1] << " " << r[2]
<< "], v = [" << v[0] << " " << v[1] << " " << v[2] << "]\n";
ang betn, omgn, alpn;
t.cart2toellip(r, v, betn, omgn, alpn);
cout << " => [bet, omg, alp] = ["
<< double(betn) << " " << double(omgn) << " " << double(alpn) << "]\n";
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}