QGIS API Documentation  2.99.0-Master (f1c3692)
gmath.h File Reference
`#include "info.h"`
Include dependency graph for gmath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define NMEA_DOP_FACTOR   (5)
Factor for translating DOP to meters. More...

#define NMEA_EARTH_FLATTENING   (1 / 298.257223563)
Earth's flattening according WGS 84. More...

#define NMEA_EARTH_SEMIMAJORAXIS_KM   (NMEA_EARTHMAJORAXIS_KM / 1000)
Earth's semi-major axis in km according WGS 84. More...

#define NMEA_EARTH_SEMIMAJORAXIS_M   (6378137.0)
Earth's semi-major axis in m according WGS84. More...

#define NMEA_EARTHRADIUS_KM   (6378)
Earth's mean radius in km. More...

#define NMEA_EARTHRADIUS_M   (NMEA_EARTHRADIUS_KM * 1000)
Earth's mean radius in m. More...

#define NMEA_PI   (3.141592653589793)
PI value. More...

#define NMEA_PI180   (NMEA_PI / 180)
PI division by 180. More...

## Functions

double nmea_calc_pdop (double hdop, double vdop)
Calculate PDOP (Position Dilution Of Precision) factor. More...

double nmea_degree2ndeg (double val)
Convert fractional degree to NDEG (NMEA degree) More...

double nmea_degree2radian (double val)

double nmea_distance (const nmeaPOS *from_pos, const nmeaPOS *to_pos)
Calculate distance between two points. More...

double nmea_distance_ellipsoid (const nmeaPOS *from_pos, const nmeaPOS *to_pos, double *from_azimuth, double *to_azimuth)
Calculate distance between two points This function uses an algorithm for an oblate spheroid earth model. More...

double nmea_dop2meters (double dop)

void nmea_info2pos (const nmeaINFO *info, nmeaPOS *pos)
Convert position from INFO to radians position. More...

double nmea_meters2dop (double meters)

int nmea_move_horz (const nmeaPOS *start_pos, nmeaPOS *end_pos, double azimuth, double distance)
Horizontal move of point position. More...

int nmea_move_horz_ellipsoid (const nmeaPOS *start_pos, nmeaPOS *end_pos, double azimuth, double distance, double *end_azimuth)
Horizontal move of point position This function uses an algorithm for an oblate spheroid earth model. More...

double nmea_ndeg2degree (double val)
Convert NDEG (NMEA degree) to fractional degree. More...

double nmea_ndeg2radian (double val)

void nmea_pos2info (const nmeaPOS *pos, nmeaINFO *info)
Convert radians position to INFOs position. More...

double nmea_radian2degree (double val)

double nmea_radian2ndeg (double val)

## ◆ NMEA_DOP_FACTOR

 #define NMEA_DOP_FACTOR   (5)

Factor for translating DOP to meters.

Definition at line 39 of file gmath.h.

## ◆ NMEA_EARTH_FLATTENING

 #define NMEA_EARTH_FLATTENING   (1 / 298.257223563)

Earth's flattening according WGS 84.

Definition at line 38 of file gmath.h.

## ◆ NMEA_EARTH_SEMIMAJORAXIS_KM

 #define NMEA_EARTH_SEMIMAJORAXIS_KM   (NMEA_EARTHMAJORAXIS_KM / 1000)

Earth's semi-major axis in km according WGS 84.

Definition at line 37 of file gmath.h.

## ◆ NMEA_EARTH_SEMIMAJORAXIS_M

 #define NMEA_EARTH_SEMIMAJORAXIS_M   (6378137.0)

Earth's semi-major axis in m according WGS84.

Definition at line 36 of file gmath.h.

## ◆ NMEA_EARTHRADIUS_KM

 #define NMEA_EARTHRADIUS_KM   (6378)

Earth's mean radius in km.

Definition at line 34 of file gmath.h.

## ◆ NMEA_EARTHRADIUS_M

 #define NMEA_EARTHRADIUS_M   (NMEA_EARTHRADIUS_KM * 1000)

Earth's mean radius in m.

Definition at line 35 of file gmath.h.

## ◆ NMEA_PI

 #define NMEA_PI   (3.141592653589793)

PI value.

Definition at line 32 of file gmath.h.

## ◆ NMEA_PI180

 #define NMEA_PI180   (NMEA_PI / 180)

PI division by 180.

Definition at line 33 of file gmath.h.

## ◆ nmea_calc_pdop()

 double nmea_calc_pdop ( double hdop, double vdop )

Calculate PDOP (Position Dilution Of Precision) factor.

Definition at line 87 of file gmath.c.

## ◆ nmea_degree2ndeg()

 double nmea_degree2ndeg ( double val )

Convert fractional degree to NDEG (NMEA degree)

Definition at line 61 of file gmath.c.

## ◆ nmea_degree2radian()

 double nmea_degree2radian ( double val )

Definition at line 38 of file gmath.c.

## ◆ nmea_distance()

 double nmea_distance ( const nmeaPOS * from_pos, const nmeaPOS * to_pos )

Calculate distance between two points.

Returns
Distance in meters
Parameters
 from_pos From position in radians to_pos To position in radians

Definition at line 102 of file gmath.c.

## ◆ nmea_distance_ellipsoid()

 double nmea_distance_ellipsoid ( const nmeaPOS * from_pos, const nmeaPOS * to_pos, double * from_azimuth, double * to_azimuth )

Calculate distance between two points This function uses an algorithm for an oblate spheroid earth model.

The algorithm is described here: http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

Returns
Distance in meters
Parameters
 from_pos From position in radians to_pos To position in radians from_azimuth (O) azimuth at "from" position in radians to_azimuth (O) azimuth at "to" position in radians

Definition at line 121 of file gmath.c.

## ◆ nmea_dop2meters()

 double nmea_dop2meters ( double dop )

Definition at line 92 of file gmath.c.

## ◆ nmea_info2pos()

 void nmea_info2pos ( const nmeaINFO * info, nmeaPOS * pos )

Convert position from INFO to radians position.

Definition at line 382 of file gmath.c.

## ◆ nmea_meters2dop()

 double nmea_meters2dop ( double meters )

Definition at line 95 of file gmath.c.

## ◆ nmea_move_horz()

 int nmea_move_horz ( const nmeaPOS * start_pos, nmeaPOS * end_pos, double azimuth, double distance )

Horizontal move of point position.

Parameters
 start_pos Start position in radians end_pos Result position in radians azimuth Azimuth (degree) [0, 359] distance Distance (km)

Definition at line 237 of file gmath.c.

## ◆ nmea_move_horz_ellipsoid()

 int nmea_move_horz_ellipsoid ( const nmeaPOS * start_pos, nmeaPOS * end_pos, double azimuth, double distance, double * end_azimuth )

Horizontal move of point position This function uses an algorithm for an oblate spheroid earth model.

The algorithm is described here: http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

Parameters
 start_pos Start position in radians end_pos (O) Result position in radians azimuth Azimuth in radians distance Distance (km) end_azimuth (O) Azimuth at end position in radians

Definition at line 271 of file gmath.c.

## ◆ nmea_ndeg2degree()

 double nmea_ndeg2degree ( double val )

Convert NDEG (NMEA degree) to fractional degree.

Definition at line 51 of file gmath.c.

## ◆ nmea_ndeg2radian()

 double nmea_ndeg2radian ( double val )

Definition at line 74 of file gmath.c.

## ◆ nmea_pos2info()

 void nmea_pos2info ( const nmeaPOS * pos, nmeaINFO * info )

Convert radians position to INFOs position.

Definition at line 391 of file gmath.c.

## ◆ nmea_radian2degree()

 double nmea_radian2degree ( double val )

Definition at line 45 of file gmath.c.

## ◆ nmea_radian2ndeg()

 double nmea_radian2ndeg ( double val )

Definition at line 81 of file gmath.c.