RhumbInverse Method

WRAPPER_API bool RhumbInverse(const GeodeticPoint &fromPoint, const GeodeticPoint &toPoint, double &azimuth, double &geodesic) const

 

Description

The RhumbInverse method computes a path of constant heading that connects the two specified points on the Ellipsoid.  A path of constant heading is called a Rhumb Line.  The first argument is the starting point, and the second argument is the destination point.  The third argument gives the calculated azimuth that one must travel from the starting point to reach the destination point.  The fourth argument gives the calculated geodesic distance along the Rhumb Line between the two points.  The method returns a boolean value indicating the success of the operation.  

The geodesic distance is given in meters, and the azimuth values are given in radians.

If three-dimensional GeodeticPoints are used with this method, the Height coordinates will be ignored.  The Height of the points will be assumed to be 0 so that the calculations will occur on the surface of the Ellipsoid.

 

Example

void Ellipsoid_RhumbInverse(GEOCALCPBW_NAMESPACE::DataSource & data)

{

GEOCALCPBW_NAMESPACE::Ellipsoid * ell = GEOCALCPBW_NAMESPACE::Ellipsoid::CreateEllipsoid();

GEOCALCPBW_NAMESPACE::LinearValue semiMaj;

semiMaj.set_InMeters(6378137);

ell->set_SemiMajor(semiMaj);

ell->set_InvFlatDefinitive(false);

GEOCALCPBW_NAMESPACE::LinearValue semiMin;

semiMin.set_InMeters(6356752.31424518);

ell->set_SemiMinor(semiMin);

 

GEOCALCPBW_NAMESPACE::GeodeticPoint * fromPt = data.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");

GEOCALCPBW_NAMESPACE::GeodeticPoint * toPt = data.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");

fromPt->set_InUnits(-77.36, 45.45);

toPt->set_InUnits(-77.43, 46.68);

double azimuth;

double geodesic;

if(! ell->RhumbInverse(*fromPt, *toPt, geodesic, azimuth))

{

AfxMessageBox("RhumbInverse failed");

}

 

delete fromPt;

delete toPt;

}