CreateEllipsoid Constructor

WRAPPER_API static Ellipsoid* CreateEllipsoid()

 

Description

The CreateEllipsoid constructor creates a new instance of the Ellipsoid class.  Upon construction, The Ellipsoid has a SemiMajor radius of one meter, a SemiMinor radius of 1 meter, and InvFlatDefinitive set to true.  

 

Example

void Ellipsoid_CreateEllipsoid(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 azimuthAhead;

double azimuthBack;

double geodesic;

if(! ell->ComputeInverse(*fromPt, *toPt, geodesic, azimuthAhead, azimuthBack))

{

AfxMessageBox("ComputeInverse failed");

}

 

delete ell;

delete fromPt;

delete toPt;

}