A Discrete-Event Network Simulator
API
geographic-positions.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 University of Washington
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Benjamin Cizdziel <ben.cizdziel@gmail.com>
19  */
20 
21 #include <ns3/vector.h>
22 #include <ns3/random-variable-stream.h>
23 
24 #ifndef GEOGRAPHIC_POSITIONS_H
25 #define GEOGRAPHIC_POSITIONS_H
26 
27 namespace ns3
28 {
29 
36 {
37 
38 public:
51  {
55  };
56 
71  static Vector GeographicToCartesianCoordinates (double latitude,
72  double longitude,
73  double altitude,
74  EarthSpheroidType sphType);
75 
94 static Vector CartesianToGeographicCoordinates (Vector pos,
95  EarthSpheroidType sphType);
96 
122  static std::list<Vector> RandCartesianPointsAroundGeographicPoint (double originLatitude,
123  double originLongitude,
124  double maxAltitude,
125  int numPoints,
126  double maxDistFromOrigin,
128 
129 };
130 
131 } // namespace ns3
132 
133 #endif /* GEOGRAPHIC_POSITIONS_H */
134 
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.
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...
Consists of methods dealing with Earth geographic coordinates and locations.
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...