Closed mcleantom closed 2 years ago
I'm not exactly sure what you're asking; an example of input and expect output would help. In the meantime, please check geod_gendirect. Setting flags
to GEOD_UNROLL
might do what you want.
@cffk Sorry I saw that in the documentation but I am very new to C++ (a few days new) and was a bit confused because of the extra parameters like ps12
which I didn't need to keep, but now I realize I can just create that variable, pass the pointer into geod_gendirect
and then ignore its value afterwards:
GeodesicCoordinate GeodesicCoordinate::forward(float NM) {
double lat2, lon2, azi2, s12, m12, M12, M21, S12;
geod_gendirect(m_GeodGeodesic, m_lat, m_lon, m_azi, GEOD_LONG_UNROLL, NM*NM_TO_M, &lat2, &lon2, &azi2, &s12, &m12, &M12, &M21, &S12);
return GeodesicCoordinate(m_GeodGeodesic, lon2, lat2, azi2);
};
Sorry for the silly question and thank you for your time!
This is more complicated than necessary; according to the documentation, you can replace the unneeded pointer arguments by 0:
geod_gendirect(m_GeodGeodesic, m_lat, m_lon, m_azi, GEOD_LONG_UNROLL,
NM*NM_TO_M, &lat2, &lon2, &azi2, 0, 0, 0, 0, 0);
@cffk Thanks, that is a lot nicer!
Sorry for the silly questions, again, very new to c++ (and thank you for your time :))
For the record, you are using the C version of GeographicLib. The C++ library is substantially more capable.
Hello :)
I was just wondering if there was a way to perform the
geod_direct
calculation so that it unwraps along the meridian and anti-meridianMy test is:
And the implementation of forward just a wrapper around geod_direct:
Thanks for any help!