icemc
 All Classes Namespaces Files Functions Variables Friends Macros Pages
position.hh
Go to the documentation of this file.
1 #ifndef POSITION_H_
2 #define POSITION_H_
3 
4 //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  Position();
29  //Default constructor: calls default constructor of Vector
30 
31  Position(Vector vec);
32 
33  Position(double theta_inp, double phi_inp);
34  //Identical to the Vector constructor with the same inputs.
35 
36  Position(double longitude, double latitude, double altitude);
37  //Constructs a position vector given a longitude, latitude,
38  //and distance from the center of the Earth.
39 
40  double Lat() const;
41  //Returns latitude, where the +z direction is at 0 latitude.
42 
43  double Lon() const;
44  //Returns longitude, where 0 degrees longitude corresponds to phi = 270 deg (-y axis),
45  //and increases clockwise.
46  //Hence, lon=0 -> phi=270,
47  //lon=90 -> phi=180,
48  //lon=180 -> phi=90,
49  //lon=270 -> phi=0,
50 
51  double Distance(const Position &second) const;
52  //Returns chord distance (direct distance between two vectors)
53 
54  double SurfaceDistance(const Position &second, double local_surface) const;
55  //Returns "surface distance" between two positions. The surface distance
56  //is the the length of arc between two positions.
57  //Altitude (i.e. length of the position vector) is irrelevant; only angle
58  //between the two position vectors is considered.
59 
60 }; //class Position
61 #endif