| LocalCartesian.hpp | | LocalCartesian.hpp | |
| /** | | /** | |
| * \file LocalCartesian.hpp | | * \file LocalCartesian.hpp | |
| * \brief Header for GeographicLib::LocalCartesian class | | * \brief Header for GeographicLib::LocalCartesian class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008, 2009, 2010, 2011) <charles@karney.co
m> | | * Copyright (c) Charles Karney (2008, 2009, 2010, 2011) <charles@karney.co
m> | |
| * and licensed under the LGPL. For more information, see | | * and licensed under the LGPL. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP) | | #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP) | |
|
| #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP "$Id: f9346d8010f4b5b4e74a65961b47
2c73578dfbfe $" | | #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP "$Id: d20959dd365321594acba2a7dea5
cd4dedfbf66a $" | |
| | | | |
| #include <GeographicLib/Geocentric.hpp> | | #include <GeographicLib/Geocentric.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Local Cartesian coordinates | | * \brief Local Cartesian coordinates | |
| * | | * | |
| * Convert between geodetic coordinates latitude = \e lat, longitude = \e | | * Convert between geodetic coordinates latitude = \e lat, longitude = \e | |
| | | | |
| skipping to change at line 122 | | skipping to change at line 122 | |
| * @param[out] M if the length of the vector is 9, fill with the rotati
on | | * @param[out] M if the length of the vector is 9, fill with the rotati
on | |
| * matrix in row-major order. | | * matrix in row-major order. | |
| * | | * | |
| * Pre-multiplying a unit vector in local cartesian coordinates at (lat
, | | * Pre-multiplying a unit vector in local cartesian coordinates at (lat
, | |
| * lon, h) by \e M transforms the vector to local cartesian coordinates
at | | * lon, h) by \e M transforms the vector to local cartesian coordinates
at | |
| * (lat0, lon0, h0). | | * (lat0, lon0, h0). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void Forward(real lat, real lon, real h, real& x, real& y, real& z, | | void Forward(real lat, real lon, real h, real& x, real& y, real& z, | |
| std::vector<real>& M) | | std::vector<real>& M) | |
| const throw() { | | const throw() { | |
|
| real t[dim2_]; | | if (M.end() == M.begin() + dim2_) { | |
| IntForward(lat, lon, h, x, y, z, t); | | real t[dim2_]; | |
| if (M.end() == M.begin() + dim2_) | | IntForward(lat, lon, h, x, y, z, t); | |
| copy(t, t + dim2_, M.begin()); | | copy(t, t + dim2_, M.begin()); | |
|
| | | } else | |
| | | IntForward(lat, lon, h, x, y, z, NULL); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Convert from local cartesian to geodetic coordinates. | | * Convert from local cartesian to geodetic coordinates. | |
| * | | * | |
| * @param[in] x local cartesian coordinate (meters). | | * @param[in] x local cartesian coordinate (meters). | |
| * @param[in] y local cartesian coordinate (meters). | | * @param[in] y local cartesian coordinate (meters). | |
| * @param[in] z local cartesian coordinate (meters). | | * @param[in] z local cartesian coordinate (meters). | |
| * @param[out] lat latitude of point (degrees). | | * @param[out] lat latitude of point (degrees). | |
| * @param[out] lon longitude of point (degrees). | | * @param[out] lon longitude of point (degrees). | |
| | | | |
| skipping to change at line 165 | | skipping to change at line 167 | |
| * @param[out] M if the length of the vector is 9, fill with the rotati
on | | * @param[out] M if the length of the vector is 9, fill with the rotati
on | |
| * matrix in row-major order. | | * matrix in row-major order. | |
| * | | * | |
| * Pre-multiplying a unit vector in local cartesian coordinates at (lat
0, | | * Pre-multiplying a unit vector in local cartesian coordinates at (lat
0, | |
| * lon0, h0) by the transpose of \e M transforms the vector to local | | * lon0, h0) by the transpose of \e M transforms the vector to local | |
| * cartesian coordinates at (lat, lon, h). | | * cartesian coordinates at (lat, lon, h). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void Reverse(real x, real y, real z, real& lat, real& lon, real& h, | | void Reverse(real x, real y, real z, real& lat, real& lon, real& h, | |
| std::vector<real>& M) | | std::vector<real>& M) | |
| const throw() { | | const throw() { | |
|
| real t[dim2_]; | | if (M.end() == M.begin() + dim2_) { | |
| IntReverse(x, y, z, lat, lon, h, t); | | real t[dim2_]; | |
| if (M.end() == M.begin() + dim2_) | | IntReverse(x, y, z, lat, lon, h, t); | |
| copy(t, t + dim2_, M.begin()); | | copy(t, t + dim2_, M.begin()); | |
|
| | | } else | |
| | | IntReverse(x, y, z, lat, lon, h, NULL); | |
| } | | } | |
| | | | |
| /** \name Inspector functions | | /** \name Inspector functions | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * @return latitude of the origin (degrees). | | * @return latitude of the origin (degrees). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real LatitudeOrigin() const throw() { return _lat0; } | | Math::real LatitudeOrigin() const throw() { return _lat0; } | |
| | | | |
| | | | |
End of changes. 5 change blocks. |
| 7 lines changed or deleted | | 11 lines changed or added | |
|