A Discrete-Event Network Simulator
API
ns3::GeographicPositions Class Reference

Consists of methods dealing with Earth geographic coordinates and locations. More...

#include "geographic-positions.h"

Public Types

enum  EarthSpheroidType { SPHERE, GRS80, WGS84 }
 Spheroid model to use for earth: perfect sphere (SPHERE), Geodetic Reference System 1980 (GRS80), or World Geodetic System 1984 (WGS84) More...
 

Static Public Member Functions

static Vector GeographicToCartesianCoordinates (double latitude, double longitude, double altitude, EarthSpheroidType sphType)
 Converts earth geographic/geodetic coordinates (latitude and longitude in degrees) with a given altitude above earth's surface (in meters) to Earth Centered Earth Fixed (ECEF) Cartesian coordinates (x, y, z in meters), where origin (0, 0, 0) is the center of the earth. More...
 
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 above earth's surface centered around a given origin point (on earth's surface, in geographic/geodetic coordinates) within a given distance radius (using arc length of earth's surface, not pythagorean distance). More...
 

Detailed Description

Consists of methods dealing with Earth geographic coordinates and locations.

Definition at line 35 of file geographic-positions.h.

Member Enumeration Documentation

◆ EarthSpheroidType

Spheroid model to use for earth: perfect sphere (SPHERE), Geodetic Reference System 1980 (GRS80), or World Geodetic System 1984 (WGS84)

Moritz, H. "Geodetic Reference System 1980." GEODETIC REFERENCE SYSTEM 1980. http://www.gfy.ku.dk/~iag/HB2000/part4/grs80_corr.htm.

"Department of Defense World Geodetic System 1984." National Imagery and Mapping Agency, 1 Jan. 2000. http://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf.

Enumerator
SPHERE 
GRS80 
WGS84 

Definition at line 50 of file geographic-positions.h.

Member Function Documentation

◆ GeographicToCartesianCoordinates()

Vector ns3::GeographicPositions::GeographicToCartesianCoordinates ( double  latitude,
double  longitude,
double  altitude,
EarthSpheroidType  sphType 
)
static

Converts earth geographic/geodetic coordinates (latitude and longitude in degrees) with a given altitude above earth's surface (in meters) to Earth Centered Earth Fixed (ECEF) Cartesian coordinates (x, y, z in meters), where origin (0, 0, 0) is the center of the earth.

Parameters
latitudeearth-referenced latitude (in degrees) of the point
longitudeearth-referenced longitude (in degrees) of the point
altitudeheight of the point (in meters) above earth's surface
sphTypeearth spheroid model to use for conversion
Returns
a vector containing the Cartesian coordinates (x, y, z referenced in meters) of the point (origin (0, 0, 0) is center of earth)

Definition at line 53 of file geographic-positions.cc.

References ns3::EARTH_GRS80_ECCENTRICITY, ns3::EARTH_RADIUS, ns3::EARTH_SEMIMAJOR_AXIS, ns3::EARTH_WGS84_ECCENTRICITY, GRS80, NS_LOG_FUNCTION_NOARGS, SPHERE, and sample-rng-plot::x.

Referenced by RandCartesianPointsAroundGeographicPoint().

+ Here is the caller graph for this function:

◆ RandCartesianPointsAroundGeographicPoint()

std::list< Vector > ns3::GeographicPositions::RandCartesianPointsAroundGeographicPoint ( double  originLatitude,
double  originLongitude,
double  maxAltitude,
int  numPoints,
double  maxDistFromOrigin,
Ptr< UniformRandomVariable uniRand 
)
static

Generates uniformly distributed random points (in ECEF Cartesian coordinates) within a given altitude above earth's surface centered around a given origin point (on earth's surface, in geographic/geodetic coordinates) within a given distance radius (using arc length of earth's surface, not pythagorean distance).

Distance radius is measured as if all generated points are on earth's surface (with altitude = 0). Assumes earth is a perfect sphere.

Parameters
originLatitudeorigin point latitude in degrees
originLongitudeorigin point longitude in degrees
maxAltitudemaximum altitude in meters above earth's surface with which random points can be generated
numPointsnumber of points to generate
maxDistFromOriginmax distance in meters from origin with which random transmitters can be generated (all transmitters are less than or equal to this distance from the origin, relative to points being on earth's surface)
uniRandpointer to the uniform random variable to use for random location and altitude generation
Returns
a list containing the vectors (x, y, z location referenced in meters from origin at center of earth) of each point generated

Definition at line 89 of file geographic-positions.cc.

References sample-rng-plot::alpha, ns3::EARTH_RADIUS, GeographicToCartesianCoordinates(), ns3::UniformRandomVariable::GetValue(), NS_LOG_FUNCTION_NOARGS, NS_LOG_WARN, and SPHERE.

Referenced by ns3::TvSpectrumTransmitterHelper::CreateRegionalTvTransmitters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: