Changeset 210 in pacpusframework for trunk/include


Ignore:
Timestamp:
Nov 6, 2013, 11:35:22 AM (11 years ago)
Author:
Marek Kurdej
Message:

Geodesie: formatting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/PacpusTools/geodesie.h

    r209 r210  
    1818#include "PacpusToolsConfig.h"
    1919
     20#include <Pacpus/kernel/pacpus.h>
     21
    2022#include <boost/math/constants/constants.hpp>
    2123#include <cmath>
     
    3638{
    3739    /// Copy ctor
    38     Matrice(const Matrice & A);
     40    Matrice(Matrice const& A);
    3941    /// Ctor
    4042    Matrice();
    4143    /// @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);
    4345
    4446    /// @todo Documentation
     
    6466};
    6567
    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);
     68PACPUSTOOLS_API Matrice TransMat(Matrice const& A);
     69PACPUSTOOLS_API Matrice ProdMat(Matrice const& A, Matrice const& B);
     70PACPUSTOOLS_API PACPUS_DEPRECATED_MSG(void Write(Matrice const& A, std::ostream& out), "use operator<<");
     71PACPUSTOOLS_API std::ostream& operator<<(std::ostream& os, Matrice const& A);
    6972
    7073////////////////////////////////////////////////////////////////////////
     
    7477public:
    7578    /// Ctor of Raf98 class.
    76     Raf98() {}
     79    Raf98();
     80
    7781    /// Dtor of Raf98 class.
    7882    ~Raf98();
    79    
     83
    8084    /// @todo Documentation
    8185    /// @param s filepath
    82     bool Load(const std::string & s);
    83    
     86    bool Load(const std::string& s);
     87
    8488    /// @todo Documentation
    8589    /// @param longitude [degrees]
    8690    /// @param latitude [degrees]
    8791    /// @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
    9094private:
    9195    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;
    9397};
    9498
     
    110114////////////////////////////////////////////////////////////////////////
    111115
    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);//degres
    116 const double phi0_Lambert93=Deg2Rad(46.5);
    117 const double phi1_Lambert93=Deg2Rad(44.0);
    118 const double phi2_Lambert93=Deg2Rad(49.0);//degres
    119 const double X0_Lambert93=700000;//
    120 const double Y0_Lambert93=6600000;//
     116const double a_Lambert93 = 6378137;
     117const double f_Lambert93 = 1 / 298.257222101;
     118const double e_Lambert93 = sqrt(f_Lambert93 * (2 - f_Lambert93));
     119const double lambda0_Lambert93 = Deg2Rad(3.0); //degres
     120const double phi0_Lambert93 = Deg2Rad(46.5);
     121const double phi1_Lambert93 = Deg2Rad(44.0);
     122const double phi2_Lambert93 = Deg2Rad(49.0); //degres
     123const double X0_Lambert93 = 700000; //
     124const double Y0_Lambert93 = 6600000; //
    121125const double n_Lambert93 = 0.7256077650;
    122126const double c_Lambert93 = 11754255.426;
     
    125129
    126130const 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);
     131const double GRS_f = 1 / 298.257222101;
     132const double GRS_b = GRS_a * (1 - GRS_f);
     133const double GRS_e = sqrt((pow(GRS_a, 2) - pow(GRS_b, 2)) / pow(GRS_a, 2));
     134
     135////////////////////////////////////////////////////////////////////////
     136PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98, double lambda, double phi, double he, Matrice in, double& E, double& N, double& h, Matrice& out);
     137PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98, double lambda, double phi, double he, double& E, double& N, double& h);
     138PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98, double E, double N, double h, double& lambda, double& phi, double& he);
     139PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98, double E, double N, double h, Matrice in, double& lambda, double& phi, double& he, Matrice& out);
    136140/** Convert from geographique to ECEF.
    137141 * @param[in] longitude Longitude in radian.
     
    145149 * @param[in] he0 Height of the origin in radian.
    146150 */
    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);
     151PACPUSTOOLS_API void ECEF_2_ENU(double x, double y, double z, double& e, double& n, double& u, double lon0, double lat0, double he0);
    148152////////////////////////////////////////////////////////////////////////
    149153
    150154///ALGO0001
    151155/// @todo Rename
    152 PACPUSTOOLS_API double LatitueIsometrique(double latitude,double e);
     156PACPUSTOOLS_API double LatitueIsometrique(double latitude, double e);
    153157///ALGO0002
    154158/// @todo Rename
    155 PACPUSTOOLS_API double LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon);
     159PACPUSTOOLS_API double LatitueIsometrique2Lat(double latitude_iso, double e, double epsilon);
    156160
    157161///ALGO0003
    158162PACPUSTOOLS_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);
    163167///ALGO0004
    164168PACPUSTOOLS_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,
    168172    double epsilon,
    169     double& lambda,double& phi);
     173    double& lambda, double& phi);
    170174
    171175PACPUSTOOLS_API double ConvMerApp(double longitude);
     
    175179*/
    176180template <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);
     181void cartesianToPolar(const _T1 x, const _T1 y, _T2& r, _T2& theta)
     182{
     183    r = std::sqrt(x * x + y * y);
    179184    theta = std::atan2(x, y);
    180185}
     
    184189*/
    185190template <typename _T1, typename _T2>
    186 void polarToCartesian(const _T1 r, const _T1 theta, _T2 & x, _T2 & y) {
     191void polarToCartesian(const _T1 r, const _T1 theta, _T2& x, _T2& y)
     192{
    187193    x = r * std::cos(theta);
    188194    y = r * std::sin(theta);
     
    194200*/
    195201template <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);
     202void 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);
    198205    theta = std::acos(z / r);
    199206    phi = std::atan2(y, x);
     
    205212*/
    206213template <typename _T1, typename _T2>
    207 void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 & x, _T2 & y, _T2 & z) {
     214void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2& x, _T2& y, _T2& z)
     215{
    208216    x = r * std::sin(theta) * std::cos(phi);
    209217    y = r * std::sin(theta) * std::sin(phi);
     
    217225namespace Geodesie
    218226{
    219     using namespace Geodesy;
     227using namespace Geodesy;
    220228} // namespace Geodesie
    221229
Note: See TracChangeset for help on using the changeset viewer.