A Discrete-Event Network Simulator
API
geographic-positions.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 University of Washington
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Benjamin Cizdziel <ben.cizdziel@gmail.com>
18  */
19 
20 #include <ns3/random-variable-stream.h>
21 #include <ns3/vector.h>
22 
23 #ifndef GEOGRAPHIC_POSITIONS_H
24 #define GEOGRAPHIC_POSITIONS_H
25 
26 namespace ns3
27 {
28 
35 {
36  public:
49  {
52  WGS84
53  };
54 
69  static Vector GeographicToCartesianCoordinates(double latitude,
70  double longitude,
71  double altitude,
72  EarthSpheroidType sphType);
73 
92  static Vector CartesianToGeographicCoordinates(Vector pos, EarthSpheroidType sphType);
93 
119  static std::list<Vector> RandCartesianPointsAroundGeographicPoint(
120  double originLatitude,
121  double originLongitude,
122  double maxAltitude,
123  int numPoints,
124  double maxDistFromOrigin,
126 };
127 
128 } // namespace ns3
129 
130 #endif /* GEOGRAPHIC_POSITIONS_H */
Consists of methods dealing with Earth geographic coordinates and locations.
static std::list< Vector > RandCartesianPointsAroundGeographicPoint(double originLatitude, double originLongitude, double maxAltitude, int numPoints, double maxDistFromOrigin, Ptr< UniformRandomVariable > uniRand)
Generates uniformly distributed random points (in ECEF Cartesian coordinates) within a given altitude...
EarthSpheroidType
Spheroid model to use for earth: perfect sphere (SPHERE), Geodetic Reference System 1980 (GRS80),...
static Vector GeographicToCartesianCoordinates(double latitude, double longitude, double altitude, EarthSpheroidType sphType)
Converts earth geographic/geodetic coordinates (latitude and longitude in degrees) with a given altit...
static Vector CartesianToGeographicCoordinates(Vector pos, EarthSpheroidType sphType)
Inverse of GeographicToCartesianCoordinates using [1].
Every class exported by the ns3 library is enclosed in the ns3 namespace.