Changeset 73 in pacpusframework for trunk/include/Pacpus
- Timestamp:
- Jan 10, 2013, 5:56:42 PM (12 years ago)
- Location:
- trunk/include/Pacpus
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/PacpusTools/geodesie.h
r71 r73 1 1 // %pacpus:license{ 2 // This file is part of the PACPUS framework distributed under the3 // CECILL-C License, Version 1.0.4 // %}5 /// @file6 /// @author Firstname Surname <firstname.surname@utc.fr>7 /// @date Month, Year8 /// @version $Id$9 /// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.10 /// @brief Brief description.11 ///12 /// Detailed description.13 14 #ifndef GEODESIE_H15 #define GEODESIE_H16 17 #include <cmath>18 #include <iostream>19 #include <vector>20 21 namespace Geodesie {22 23 #ifndef M_PI24 # define M_PI 3.1415926535897932384625 #endif26 #ifndef M_PI_227 # define M_PI_2 1.5707963267948966192328 #endif29 #ifndef M_PI_430 # define M_PI_4 0.7853981633974483096231 #endif32 33 /// 9x9 matrix ???34 ///35 /// @todo Documentation36 /// @todo Rewrite!37 struct Matrice38 {39 /// Copy ctor40 Matrice(const Matrice & A);41 /// Ctor42 Matrice();43 /// @todo Documentation44 void Apply(double v0, double v1, double v2, double & Mv0, double & Mv1, double & Mv2);45 46 /// @todo Documentation47 double c0_l0;48 /// @todo Documentation49 double c1_l0;50 /// @todo Documentation51 double c2_l0;52 53 /// @todo Documentation54 double c0_l1;55 /// @todo Documentation56 double c1_l1;57 /// @todo Documentation58 double c2_l1;59 60 /// @todo Documentation61 double c0_l2;62 /// @todo Documentation63 double c1_l2;64 /// @todo Documentation65 double c2_l2;66 };67 68 Matrice TransMat(const Matrice A);69 70 Matrice ProdMat(const Matrice A,const Matrice B);71 void Write(const Matrice A,std::ostream& out);72 73 ////////////////////////////////////////////////////////////////////////74 /// @todo Documentation75 class Raf9876 {77 public:78 /// Ctor of Raf98 class.79 Raf98() {}80 /// Dtor of Raf98 class.81 ~Raf98();82 83 /// @todo Documentation84 /// @param s filepath85 bool Load(const std::string & s);86 87 /// @todo Documentation88 /// @param longitude [degrees]89 /// @param latitude [degrees]90 /// @param Hwgs84 Output: interpolated altitude using WGS84 geoid model [meters]91 bool Interpol(double longitude/*deg*/, double latitude/*deg*/, double* Hwgs84) const;92 93 private:94 std::vector<double> m_dvalues;95 double LitGrille(unsigned int c,unsigned int l) const;96 };97 98 ////////////////////////////////////////////////////////////////////////99 100 ////////////////////////////////////////////////////////////////////////101 inline double Deg2Rad(double deg) {return deg*M_PI/180.0;}102 inline double Rad2Deg(double rad) {return rad*180.0/M_PI;}103 ////////////////////////////////////////////////////////////////////////104 105 const double a_Lambert93=6378137;106 const double f_Lambert93=1 / 298.257222101;107 const double e_Lambert93=sqrt(f_Lambert93*(2-f_Lambert93));108 const double lambda0_Lambert93=Deg2Rad(3.0);//degres109 const double phi0_Lambert93=Deg2Rad(46.5);110 const double phi1_Lambert93=Deg2Rad(44.0);111 const double phi2_Lambert93=Deg2Rad(49.0);//degres112 const double X0_Lambert93=700000;//113 const double Y0_Lambert93=6600000;//114 const double n_Lambert93 = 0.7256077650;115 const double c_Lambert93 = 11754255.426;116 const double xs_Lambert93 = 700000;117 const double ys_Lambert93 = 12655612.050;118 119 const double GRS_a = 6378137;120 const double GRS_f = 1/298.257222101;121 const double GRS_b = GRS_a*(1-GRS_f);122 const double GRS_e = sqrt((pow(GRS_a,2) - pow(GRS_b,2)) / pow(GRS_a,2));123 124 ////////////////////////////////////////////////////////////////////////125 void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out);126 void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,double& E,double& N,double& h);127 void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,double& lambda,double& phi,double& he);128 void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out);129 /** Convert from geographique to ECEF.130 * @param[in] longitude Longitude in radian.131 * @param[in] latitude Latitude in radian.132 * @param[in] he Height in meter.133 */134 void Geographique_2_ECEF(double longitude, double latitude, double he, double& x, double& y, double& z);135 /** Convert from ECEF two ENU.136 * @param[in] lon0 Longitude of the origin in radian.137 * @param[in] lat0 Latitude of the origin in radian.138 * @param[in] he0 Height of the origin in radian.139 */140 void ECEF_2_ENU(double x,double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0);141 ////////////////////////////////////////////////////////////////////////142 143 ///ALGO0001144 /// @todo Rename145 double LatitueIsometrique(double latitude,double e);146 ///ALGO0002147 /// @todo Rename148 double LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon);149 150 ///ALGO0003151 void Geo2ProjLambert(152 double lambda,double phi,153 double n, double c,double e,154 double lambdac,double xs,double ys,155 double& X,double& Y);156 ///ALGO0004157 void Proj2GeoLambert(158 double X,double Y,159 double n, double c,double e,160 double lambdac,double xs,double ys,161 double epsilon,162 double& lambda,double& phi);163 164 double ConvMerApp(double longitude);165 166 /**167 Converts Cartesian (x, y) coordinates to polar coordinates (r, theta)168 */169 template <typename _T1, typename _T2>170 void cartesianToPolar(const _T1 x, const _T1 y, _T2 & r, _T2 & theta) {171 r = std::sqrt(x*x + y*y);172 theta = std::atan2(x, y);173 }174 175 /**176 Converts polar coordinates (r, theta) to Cartesian (x, y) coordinates177 */178 template <typename _T1, typename _T2>179 void polarToCartesian(const _T1 r, const _T1 theta, _T2 & x, _T2 & y) {180 x = r * std::cos(theta);181 y = r * std::sin(theta);182 }183 184 /**185 Converts Cartesian (x, y, z) coordinates to spherical coordinates (r, theta, phi)186 Angles expressed in radians.187 */188 template <typename _T1, typename _T2>189 void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 & r, _T2 & theta, _T2 & phi) {190 r = std::sqrt(x*x + y*y + z*z);191 theta = std::acos(z / r);192 phi = std::atan2(y, x);193 }194 195 /**196 Converts spherical coordinates (r, theta, phi) to Cartesian (x, y, z) coordinates.197 Angles expressed in radians.198 */199 template <typename _T1, typename _T2>200 void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 & x, _T2 & y, _T2 & z) {201 x = r * std::sin(theta) * std::cos(phi);202 y = r * std::sin(theta) * std::sin(phi);203 z = r * std::cos(theta);204 }205 206 } // namespace Geodesie207 208 #endif // GEODESIE_H -
trunk/include/Pacpus/kernel/Log.h
r71 r73 1 // %pacpus:license{ 1 2 // This file is part of the PACPUS framework distributed under the 2 3 // CECILL-C License, Version 1.0. 3 // 4 // %pacpus:license} 4 5 /// @file 5 6 /// @author Marek Kurdej <firstname.surname@utc.fr>
Note:
See TracChangeset
for help on using the changeset viewer.