USML
wvector1.h
1 
5 #ifndef USML_TYPES_WVECTOR1_H
6 #define USML_TYPES_WVECTOR1_H
7 
8 #include <usml/ublas/ublas.h>
9 #include <usml/types/wvector.h>
10 
11 namespace usml {
12 namespace types {
13 
14 using namespace usml::ublas;
15 
16 class wvector1; // forward reference
17 
20 
27 class USML_DECLSPEC wvector1
28 {
29 
30 public:
31 
32  //*********************************
33  // initialization
34 
38  wvector1(double r = 0.0, double t = 0.0, double p = 0.0);
39 
43  wvector1(const wvector& other, unsigned row, unsigned col);
44 
45  //*********************************
46  // Rho property
47 
48 private:
49 
51  double _rho;
52 
53 public:
54 
60  inline double rho() const
61  {
62  return _rho;
63  }
64 
70  inline void rho(double r)
71  {
72  _rho = r;
73  }
74 
75  //*********************************
76  // Theta property
77 
78 private:
79 
81  double _theta;
82 
83 public:
84 
91  inline double theta() const
92  {
93  return _theta;
94  }
95 
101  inline void theta(double t)
102  {
103  _theta = t;
104  }
105 
106  //*********************************
107  // Phi property
108 
109 private:
110 
112  double _phi;
113 
114 public:
115 
122  inline double phi() const
123  {
124  return _phi;
125  }
126 
132  inline void phi(double p)
133  {
134  _phi = p;
135  }
136 
137  //*********************************
138  // utilities
139 
143  void clear();
144 
152  double dot(const wvector1& other) const;
153 
160  double dotnorm(const wvector1& other) const;
161 
169  double distance(const wvector1& origin) const;
170 
178  double distance2(const wvector1& origin) const;
179 
191  void direction(double* de, double* az);
192 
202  void direction(const wvector1& pos, const wvector1& dir);
203 
214  void direction(const wvector1& pos, wvector1* dir);
215 
233  double area(const wvector1& p2, const wvector1& p3) const;
234 
245  double area(const wvector1& p2, const wvector1& p3, const wvector1& p4) const;
246 };
247 
249 } // end of ocean namespace
250 } // end of usml namespace
251 
252 #endif
double _rho
Storage for the radial component of the coordinate system.
Definition: wvector1.h:51
double _theta
Storage for the colatitude component of the coordinate system.
Definition: wvector1.h:81
double _phi
Storage for the longitude component of the coordinate system.
Definition: wvector1.h:112
Individual world vector in spherical earth coordinates.
Definition: wvector1.h:27
double theta() const
Retrieves the colatitude component of the spherical earth coordinate system.
Definition: wvector1.h:91
double phi() const
Retrieves the longitude component of the spherical earth coordinate system.
Definition: wvector1.h:122
void rho(double r)
Defines the radial component of the spherical earth coordinate.
Definition: wvector1.h:70
void theta(double t)
Defines the colatitude component of the spherical earth coordinate.
Definition: wvector1.h:101
void phi(double p)
Defines the longitude component of the spherical earth coordinate.
Definition: wvector1.h:132
double rho() const
Retrieves the radial component of the spherical earth coordinate system.
Definition: wvector1.h:60
World vector in spherical earth coordinates.
Definition: wvector.h:42