position.hh
1 #ifndef POSITION_H_
2 #define POSITION_H_
3 //class Position:
5 //This class is a 3-vector that represents a position on the Earth's surface.
6 //
7 // Methods:
8 //
9 // Lat() : Returns latitude of this position.
10 //
11 // Lon() : Returns longitude of this position.
12 //
13 // Distance(second position) : Returns distance between this position and a second. Takes
14 // a Position as input.
15 //
16 // SurfaceDistance(second position, surface elevation) : Returns distance over the surface of
17 // the Earth between the spot on the surface under/above this position and the spot
18 // under/above a second position.
19 // Input: a Position, and the distance from the center of the Earth to the surface at
20 // this Position.
21 //
23 #include "vector.hh"
24 
26 class Position : public Vector {
27 public:
28 
30  Position();
31 
32  Position(Vector vec);
33 
35  Position(double theta_inp, double phi_inp);
36 
39  Position(double longitude, double latitude, double altitude);
40 
42  double Lat() const;
43 
45 
53  double Lon() const;
54 
56  double Distance(const Position &second) const;
57 
59 
65  double SurfaceDistance(const Position &second, double local_surface) const;
66 
67 }; //class Position
68 #endif
double Distance(const Position &second) const
Returns chord distance (direct distance between two vectors)
Definition: position.cc:37
double Lat() const
Returns latitude, where the +z direction is at 0 latitude.
Definition: position.cc:47
This class is a 3-vector that represents a position on the Earth's surface.
Definition: position.hh:26
double SurfaceDistance(const Position &second, double local_surface) const
Returns "surface distance" between two positions.
Definition: position.cc:43
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
Definition: vector.hh:27
Position()
Default constructor: calls default constructor of Vector.
Definition: position.cc:7
double Lon() const
Returns longitude.
Definition: position.cc:51