23 using namespace MSP::CCS;
31 double ellipsoidSemiMajorAxis,
32 double ellipsoidFlattening) :
33 Geocentric(ellipsoidSemiMajorAxis, ellipsoidFlattening)
51 double x = geodetic->
x();
52 double y = geodetic->
y();
53 double z = geodetic->
z();
56 double lat, lon, radius;
68 double radius = sphericalCoordinate->
radius();
78 const double longitude,
79 const double latitude,
85 double sinLon = sin(longitude);
86 double cosLon = cos(longitude);
87 double sinLat = sin(latitude);
88 double cosLat = cos(latitude);
90 x = radius * cosLat * cosLon;
91 y = radius * cosLat * sinLon;
101 double &radius)
const
103 if(x == 0.0 && y == 0.0)
106 longitude = atan2(y, x);
108 radius = sqrt(x*x + y*y + z*z);
112 latitude = asin(z / radius);
double sphericalLatitude() const
Spherical(double ellipsoidSemiMajorAxis, double ellipsoidFlattening)
MSP::CCS::GeodeticCoordinates * convertToGeodetic(MSP::CCS::CartesianCoordinates *cartesianCoordinates)
void geocentricToSpherical(const double x, const double y, const double z, double &longitude, double &latitude, double &radius) const
MSP::CCS::CartesianCoordinates * convertFromGeodetic(const MSP::CCS::GeodeticCoordinates *geodeticCoordinates)
MSP::CCS::SphericalCoordinates * convertFromGeodetic(const MSP::CCS::GeodeticCoordinates *geodeticCoordinate)
MSP::CCS::GeodeticCoordinates * convertToGeodetic(MSP::CCS::SphericalCoordinates *sphericalCoordinate)
void sphericalToGeocentric(const double longitude, const double latitude, const double radius, double &x, double &y, double &z) const
double sphericalLongitude() const