wvector1.h

00001 
00005 #pragma once
00006 
00007 #include <usml/ublas/ublas.h>
00008 #include <usml/types/wvector.h>
00009 
00010 namespace usml {
00011 namespace types {
00012 
00013 using namespace usml::ublas;
00014 
00015 class wvector1; // forward reference
00016 
00019 
00026 class USML_DECLSPEC wvector1
00027 {
00028 
00029 public:
00030 
00031     //*********************************
00032     // initialization
00033 
00037     wvector1(double r = 0.0, double t = 0.0, double p = 0.0);
00038 
00042     wvector1(const wvector& other, size_t row, size_t col);
00043 
00044     //*********************************
00045     // Rho property
00046 
00047 private:
00048 
00050     double _rho;
00051 
00052 public:
00053 
00059     inline double rho() const
00060     {
00061         return _rho;
00062     }
00063 
00069     inline void rho(double r)
00070     {
00071         _rho = r;
00072     }
00073 
00074     //*********************************
00075     // Theta property
00076 
00077 private:
00078 
00080     double _theta;
00081 
00082 public:
00083 
00090     inline double theta() const
00091     {
00092         return _theta;
00093     }
00094 
00100     inline void theta(double t)
00101     {
00102         _theta = t;
00103     }
00104 
00105     //*********************************
00106     // Phi property
00107 
00108 private:
00109 
00111     double _phi;
00112 
00113 public:
00114 
00121     inline double phi() const
00122     {
00123         return _phi;
00124     }
00125 
00131     inline void phi(double p)
00132     {
00133         _phi = p;
00134     }
00135 
00136     //*********************************
00137     // utilities
00138 
00142     void clear();
00143 
00151     double dot(const wvector1& other) const;
00152 
00159     double dotnorm(const wvector1& other) const;
00160 
00168     double distance(const wvector1& origin) const;
00169 
00177     double distance2(const wvector1& origin) const;
00178 
00190     void direction(double* de, double* az) const ;
00191 
00201     void direction(const wvector1& pos, const wvector1& dir);
00202 
00213     void direction(const wvector1& pos, wvector1* dir);
00214 
00232     double area(const wvector1& p2, const wvector1& p3) const;
00233 
00244     double area(const wvector1& p2, const wvector1& p3, const wvector1& p4) const;
00245 };
00246 
00248 } // end of ocean namespace
00249 } // end of usml namespace

Generated on 4 May 2015 for USML by  doxygen 1.6.1