Changeset 210 in pacpusframework for trunk/include
- Timestamp:
- Nov 6, 2013, 11:35:22 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/PacpusTools/geodesie.h
r209 r210 18 18 #include "PacpusToolsConfig.h" 19 19 20 #include <Pacpus/kernel/pacpus.h> 21 20 22 #include <boost/math/constants/constants.hpp> 21 23 #include <cmath> … … 36 38 { 37 39 /// Copy ctor 38 Matrice( const Matrice& A);40 Matrice(Matrice const& A); 39 41 /// Ctor 40 42 Matrice(); 41 43 /// @todo Documentation 42 void Apply(double v0, double v1, double v2, double & Mv0, double & Mv1, double& Mv2);44 void Apply(double v0, double v1, double v2, double& Mv0, double& Mv1, double& Mv2); 43 45 44 46 /// @todo Documentation … … 64 66 }; 65 67 66 PACPUSTOOLS_API Matrice TransMat(const Matrice A); 67 PACPUSTOOLS_API Matrice ProdMat(const Matrice A, const Matrice B); 68 PACPUSTOOLS_API void Write(const Matrice A, std::ostream & out); 68 PACPUSTOOLS_API Matrice TransMat(Matrice const& A); 69 PACPUSTOOLS_API Matrice ProdMat(Matrice const& A, Matrice const& B); 70 PACPUSTOOLS_API PACPUS_DEPRECATED_MSG(void Write(Matrice const& A, std::ostream& out), "use operator<<"); 71 PACPUSTOOLS_API std::ostream& operator<<(std::ostream& os, Matrice const& A); 69 72 70 73 //////////////////////////////////////////////////////////////////////// … … 74 77 public: 75 78 /// Ctor of Raf98 class. 76 Raf98() {} 79 Raf98(); 80 77 81 /// Dtor of Raf98 class. 78 82 ~Raf98(); 79 83 80 84 /// @todo Documentation 81 85 /// @param s filepath 82 bool Load(const std::string 83 86 bool Load(const std::string& s); 87 84 88 /// @todo Documentation 85 89 /// @param longitude [degrees] 86 90 /// @param latitude [degrees] 87 91 /// @param Hwgs84 Output: interpolated altitude using WGS84 geoid model [meters] 88 bool Interpol(double longitude /*deg*/, double latitude/*deg*/, double* Hwgs84) const;89 92 bool Interpol(double longitude /*deg*/, double latitude /*deg*/, double* Hwgs84) const; 93 90 94 private: 91 95 std::vector<double> m_dvalues; 92 double LitGrille(unsigned int c, unsigned int l) const;96 double LitGrille(unsigned int c, unsigned int l) const; 93 97 }; 94 98 … … 110 114 //////////////////////////////////////////////////////////////////////// 111 115 112 const double a_Lambert93 =6378137;113 const double f_Lambert93 =1 / 298.257222101;114 const double e_Lambert93 =sqrt(f_Lambert93*(2-f_Lambert93));115 const double lambda0_Lambert93 =Deg2Rad(3.0);//degres116 const double phi0_Lambert93 =Deg2Rad(46.5);117 const double phi1_Lambert93 =Deg2Rad(44.0);118 const double phi2_Lambert93 =Deg2Rad(49.0);//degres119 const double X0_Lambert93 =700000;//120 const double Y0_Lambert93 =6600000;//116 const double a_Lambert93 = 6378137; 117 const double f_Lambert93 = 1 / 298.257222101; 118 const double e_Lambert93 = sqrt(f_Lambert93 * (2 - f_Lambert93)); 119 const double lambda0_Lambert93 = Deg2Rad(3.0); //degres 120 const double phi0_Lambert93 = Deg2Rad(46.5); 121 const double phi1_Lambert93 = Deg2Rad(44.0); 122 const double phi2_Lambert93 = Deg2Rad(49.0); //degres 123 const double X0_Lambert93 = 700000; // 124 const double Y0_Lambert93 = 6600000; // 121 125 const double n_Lambert93 = 0.7256077650; 122 126 const double c_Lambert93 = 11754255.426; … … 125 129 126 130 const double GRS_a = 6378137; 127 const double GRS_f = 1 /298.257222101;128 const double GRS_b = GRS_a *(1-GRS_f);129 const double GRS_e = sqrt((pow(GRS_a, 2) - pow(GRS_b,2)) / pow(GRS_a,2));130 131 //////////////////////////////////////////////////////////////////////// 132 PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98, double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out);133 PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98, double lambda,double phi,double he,double& E,double& N,double& h);134 PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98, double E,double N,double h,double& lambda,double& phi,double& he);135 PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98, double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out);131 const double GRS_f = 1 / 298.257222101; 132 const double GRS_b = GRS_a * (1 - GRS_f); 133 const double GRS_e = sqrt((pow(GRS_a, 2) - pow(GRS_b, 2)) / pow(GRS_a, 2)); 134 135 //////////////////////////////////////////////////////////////////////// 136 PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98, double lambda, double phi, double he, Matrice in, double& E, double& N, double& h, Matrice& out); 137 PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98, double lambda, double phi, double he, double& E, double& N, double& h); 138 PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98, double E, double N, double h, double& lambda, double& phi, double& he); 139 PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98, double E, double N, double h, Matrice in, double& lambda, double& phi, double& he, Matrice& out); 136 140 /** Convert from geographique to ECEF. 137 141 * @param[in] longitude Longitude in radian. … … 145 149 * @param[in] he0 Height of the origin in radian. 146 150 */ 147 PACPUSTOOLS_API void ECEF_2_ENU(double x, double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0);151 PACPUSTOOLS_API void ECEF_2_ENU(double x, double y, double z, double& e, double& n, double& u, double lon0, double lat0, double he0); 148 152 //////////////////////////////////////////////////////////////////////// 149 153 150 154 ///ALGO0001 151 155 /// @todo Rename 152 PACPUSTOOLS_API double LatitueIsometrique(double latitude, double e);156 PACPUSTOOLS_API double LatitueIsometrique(double latitude, double e); 153 157 ///ALGO0002 154 158 /// @todo Rename 155 PACPUSTOOLS_API double LatitueIsometrique2Lat(double latitude_iso, double e,double epsilon);159 PACPUSTOOLS_API double LatitueIsometrique2Lat(double latitude_iso, double e, double epsilon); 156 160 157 161 ///ALGO0003 158 162 PACPUSTOOLS_API void Geo2ProjLambert( 159 double lambda, double phi,160 double n, double c, double e,161 double lambdac, double xs,double ys,162 double& X, double& Y);163 double lambda, double phi, 164 double n, double c, double e, 165 double lambdac, double xs, double ys, 166 double& X, double& Y); 163 167 ///ALGO0004 164 168 PACPUSTOOLS_API void Proj2GeoLambert( 165 double X, double Y,166 double n, double c, double e,167 double lambdac, double xs,double ys,169 double X, double Y, 170 double n, double c, double e, 171 double lambdac, double xs, double ys, 168 172 double epsilon, 169 double& lambda, double& phi);173 double& lambda, double& phi); 170 174 171 175 PACPUSTOOLS_API double ConvMerApp(double longitude); … … 175 179 */ 176 180 template <typename _T1, typename _T2> 177 void cartesianToPolar(const _T1 x, const _T1 y, _T2 & r, _T2 & theta) { 178 r = std::sqrt(x*x + y*y); 181 void cartesianToPolar(const _T1 x, const _T1 y, _T2& r, _T2& theta) 182 { 183 r = std::sqrt(x * x + y * y); 179 184 theta = std::atan2(x, y); 180 185 } … … 184 189 */ 185 190 template <typename _T1, typename _T2> 186 void polarToCartesian(const _T1 r, const _T1 theta, _T2 & x, _T2 & y) { 191 void polarToCartesian(const _T1 r, const _T1 theta, _T2& x, _T2& y) 192 { 187 193 x = r * std::cos(theta); 188 194 y = r * std::sin(theta); … … 194 200 */ 195 201 template <typename _T1, typename _T2> 196 void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 & r, _T2 & theta, _T2 & phi) { 197 r = std::sqrt(x*x + y*y + z*z); 202 void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2& r, _T2& theta, _T2& phi) 203 { 204 r = std::sqrt(x * x + y * y + z * z); 198 205 theta = std::acos(z / r); 199 206 phi = std::atan2(y, x); … … 205 212 */ 206 213 template <typename _T1, typename _T2> 207 void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 & x, _T2 & y, _T2 & z) { 214 void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2& x, _T2& y, _T2& z) 215 { 208 216 x = r * std::sin(theta) * std::cos(phi); 209 217 y = r * std::sin(theta) * std::sin(phi); … … 217 225 namespace Geodesie 218 226 { 219 227 using namespace Geodesy; 220 228 } // namespace Geodesie 221 229
Note:
See TracChangeset
for help on using the changeset viewer.