A geodesic line. More...
#include <GeographicLib/Geodesic.hpp>
Public Member Functions | |
GeodesicLine () throw () | |
Math::real | Position (real s12, real &lat2, real &lon2, real &azi2, real &m12, bool arcmode=false) const throw () |
void | Scale (real a12, real &M12, real &M21) const throw () |
bool | Init () const throw () |
Math::real | Latitude () const throw () |
Math::real | Longitude () const throw () |
Math::real | Azimuth () const throw () |
Math::real | EquatorialAzimuth () const throw () |
Math::real | EquatorialArc () const throw () |
Math::real | MajorRadius () const throw () |
Math::real | InverseFlattening () const throw () |
Friends | |
class | Geodesic |
A geodesic line.
GeodesicLine facilitates the determination of a series of points on a single geodesic. Geodesic.Line returns a GeodesicLine object with the geodesic defined by by lat1, lon1, and azi1. GeodesicLine.Position returns the lat2, lon2, azi2, and m12 given s12. An example of use of this class is:
// Print positions on a geodesic going through latitude 30, // longitude 10 at azimuth 80. Points at intervals of 10km // in the range [-1000km, 1000km] are given. GeographicLib::GeodesicLine line(GeographicLib::Geodesic::WGS84.Line(30.0, 10.0, 80.0)); double step = 10e3; for (int s = -100; s <= 100; ++s) { double lat2, lon2, azi2, m12; double s12 = s * step; line.Position(s12, lat2, lon2, azi2, m12); cout << s12 << " " << lat2 << " " << lon2 << " " << azi2 << " " << m12 << "\n"; }
The default copy constructor and assignment operators work with this class, so that, for example, the previous example could start
GeographicLib::GeodesicLine line; line = GeographicLib::Geodesic::WGS84.Line(30.0, 10.0, 80.0); ...
Similarly, a vector can be used to hold GeodesicLine objects.
The calculations are accurate to better than 12 nm. (See Accuracy of geodesic calculation for details.)
Definition at line 246 of file Geodesic.hpp.
GeographicLib::GeodesicLine::GeodesicLine | ( | ) | throw () [inline] |
A default constructor. If GeodesicLine::Position is called on the resulting object, it returns immediately (without doing any calculations). The object should be set with a call to Geodesic::Line. Use Init() to test whether object is still in this uninitialized state.
Definition at line 271 of file Geodesic.hpp.
Math::real GeographicLib::GeodesicLine::Position | ( | real | s12, | |
real & | lat2, | |||
real & | lon2, | |||
real & | azi2, | |||
real & | m12, | |||
bool | arcmode = false | |||
) | const throw () |
Return the latitude, lat2, longitude, lon2, and forward azimuth, azi2 (degrees) of the point 2 which is a distance, s12 (in meters), from point 1. Also return the reduced length m12 (meters). s12 can be signed. If arcmode (default false) is set to true, s12 is interpreted as the arc length a12 (in degrees) on the auxiliary sphere. Returned value is the arc length a12 (degrees) if arcmode is false, otherwise it is the distance s12 (meters).
Definition at line 625 of file Geodesic.cpp.
References GeographicLib::Constants::degree(), and GeographicLib::Math::hypot().
Referenced by GeographicLib::Geodesic::Direct(), and GeographicLib::CassiniSoldner::Reverse().
void GeographicLib::GeodesicLine::Scale | ( | real | a12, | |
real & | M12, | |||
real & | M21 | |||
) | const throw () |
Return the scale of the geodesic line extending an arc length a12 (degrees) from point 1 to point 2. M12 (a number) measures the convergence of initially parallel geodesics. It is defined by the following construction: starting at point 1 proceed at azimuth azi1 + 90o a small distance dt; turn -90o and proceed a distance s12 (not the arc length a12); the distance to point 2 is given by M12 dt. M21 is defined analogously.
Definition at line 702 of file Geodesic.cpp.
References GeographicLib::Constants::degree().
Referenced by GeographicLib::CassiniSoldner::Forward(), and GeographicLib::CassiniSoldner::Reverse().
bool GeographicLib::GeodesicLine::Init | ( | ) | const throw () [inline] |
Has this object been initialized so that Position can be called?
Definition at line 300 of file Geodesic.hpp.
Referenced by Azimuth(), EquatorialArc(), EquatorialAzimuth(), GeographicLib::CassiniSoldner::Init(), InverseFlattening(), Latitude(), Longitude(), and MajorRadius().
Math::real GeographicLib::GeodesicLine::Latitude | ( | ) | const throw () [inline] |
Return the latitude of point 1 (degrees).
Definition at line 305 of file Geodesic.hpp.
References Init().
Referenced by GeographicLib::CassiniSoldner::LatitudeOrigin().
Math::real GeographicLib::GeodesicLine::Longitude | ( | ) | const throw () [inline] |
Return the longitude of point 1 (degrees).
Definition at line 310 of file Geodesic.hpp.
References Init().
Referenced by GeographicLib::CassiniSoldner::LongitudeOrigin().
Math::real GeographicLib::GeodesicLine::Azimuth | ( | ) | const throw () [inline] |
Return the azimuth (degrees) of the geodesic line as it passes through point 1.
Definition at line 316 of file Geodesic.hpp.
References Init().
Math::real GeographicLib::GeodesicLine::EquatorialAzimuth | ( | ) | const throw () [inline] |
Return the azimuth (degrees) of the geodesic line as it crosses the equator in a northward direction.
Definition at line 322 of file Geodesic.hpp.
References GeographicLib::Constants::degree(), and Init().
Referenced by GeographicLib::CassiniSoldner::Forward().
Math::real GeographicLib::GeodesicLine::EquatorialArc | ( | ) | const throw () [inline] |
Return the arc length (degrees) between the northward equatorial crossing and point 1.
Definition at line 330 of file Geodesic.hpp.
References GeographicLib::Constants::degree(), and Init().
Math::real GeographicLib::GeodesicLine::MajorRadius | ( | ) | const throw () [inline] |
The major radius of the ellipsoid (meters). This is that value of a inherited from the Geodesic object used in the constructor.
Definition at line 338 of file Geodesic.hpp.
References Init().
Math::real GeographicLib::GeodesicLine::InverseFlattening | ( | ) | const throw () [inline] |
The inverse flattening of the ellipsoid. This is that value of r inherited from the Geodesic object used in the constructor. A value of 0 is returned for a sphere (infinite inverse flattening).
Definition at line 345 of file Geodesic.hpp.
References Init().
friend class Geodesic [friend] |
Definition at line 249 of file Geodesic.hpp.