Skip to content

Commit

Permalink
SphericalCoordinates : make query methods const (#452)
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya <aditya050995@gmail.com>
  • Loading branch information
adityapande-1995 authored Jul 5, 2022
1 parent 33a4827 commit 3827f4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions include/gz/math/SphericalCoordinates.hh
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,19 @@ namespace gz

/// \brief Get the radius of the surface.
/// \return radius of the surface in use.
public: double SurfaceRadius();
public: double SurfaceRadius() const;

/// \brief Get the major axis of the surface.
/// \return Equatorial axis of the surface in use.
public: double SurfaceAxisEquatorial();
public: double SurfaceAxisEquatorial() const;

/// \brief Get the minor axis of the surface.
/// \return Polar axis of the surface in use.
public: double SurfaceAxisPolar();
public: double SurfaceAxisPolar() const;

/// \brief Get the flattening of the surface.
/// \return Flattening parameter of the surface in use.
public: double SurfaceFlattening();
public: double SurfaceFlattening() const;

/// \brief Get reference geodetic latitude.
/// \return Reference geodetic latitude.
Expand Down
10 changes: 6 additions & 4 deletions src/SphericalCoordinates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ double SphericalCoordinates::Distance(const gz::math::Angle &_latA,
const gz::math::Angle &_latB,
const gz::math::Angle &_lonB)
{
// LCOV_EXCL_START
return gz::math::SphericalCoordinates::DistanceWGS84(
_latA, _lonA, _latB, _lonB);
// LCOV_EXCL_STOP
}

//////////////////////////////////////////////////
Expand All @@ -460,25 +462,25 @@ double SphericalCoordinates::DistanceBetweenPoints(
}

//////////////////////////////////////////////////
double SphericalCoordinates::SurfaceRadius()
double SphericalCoordinates::SurfaceRadius() const
{
return this->dataPtr->surfaceRadius;
}

//////////////////////////////////////////////////
double SphericalCoordinates::SurfaceAxisEquatorial()
double SphericalCoordinates::SurfaceAxisEquatorial() const
{
return this->dataPtr->ellA;
}

//////////////////////////////////////////////////
double SphericalCoordinates::SurfaceAxisPolar()
double SphericalCoordinates::SurfaceAxisPolar() const
{
return this->dataPtr->ellB;
}

//////////////////////////////////////////////////
double SphericalCoordinates::SurfaceFlattening()
double SphericalCoordinates::SurfaceFlattening() const
{
return this->dataPtr->ellF;
}
Expand Down

0 comments on commit 3827f4c

Please sign in to comment.