util — coordinates / utilities
Coordinate conversion, distance and azimuth utilities
createTexture
Section titled “createTexture”Prototype
Section titled “Prototype”GLuint createTexture()Function
Section titled “Function”Create a name of OpenGL Texture.
Parameters
Section titled “Parameters”None
Return Value
Section titled “Return Value”OpenGL Texture Name
deleteTexture
Section titled “deleteTexture”Prototype
Section titled “Prototype”GLuint deleteTexture( GLuint tex )Function
Section titled “Function”Delete a name of OpenGL Texture.
Parameters
Section titled “Parameters”GLuint tex : IN (OpenGL Texture Name)
Return Value
Section titled “Return Value”Always 0
distVincenty
Section titled “distVincenty”Prototype
Section titled “Prototype”double distVincenty( double lat1, double lon1, double lat2, double lon2 )Function
Section titled “Function”Calculate the distance between diameters according to Vincenty’s algorithm. The calculation results are slower but more accurate than other algorithms.
Parameters
Section titled “Parameters”- double lat1 : IN (Latitude, degree)
- double lon1 : IN (Longitude, degree)
- double lat2 : IN (Latitude, degree)
- double lon2 : IN (Longitude, degree)
Return Values
Section titled “Return Values”Distance between two latitudes and longitudes (in meters)
distHaversine
Section titled “distHaversine”Prototype
Section titled “Prototype”double distHaversine( double lat1, double lon1, double lat2, double lon2 )Function
Section titled “Function”Calculate the distance between diameters according to Haversine algorithm. The result is faster than other algorithms but less accurate.
Parameters
Section titled “Parameters”- double lat1 : IN (Latitude, degree)
- double lon1 : IN (Longitude, degree)
- double lat2 : IN (Latitude, degree)
- double lon2 : IN (Longitude, degree)
Return Values
Section titled “Return Values”Distance between two latitudes and longitudes (in meters)
destVincenty
Section titled “destVincenty”Prototype
Section titled “Prototype”void destVincenty(double lat1, double lon1, double bearing, double dist, double &lat2out, double &lon2out)Function
Section titled “Function”Calculate the latitude and longitude values of the coordinates corresponding to angles and distances from one latitude and longitude point using the Vincenty algorithm.
Parameters
Section titled “Parameters”- double lat1 : IN (Latitude, degree)
- double lon1 : IN (Longitude, degree)
- double dist : IN (Distance, meter)
- double bearing : IN (Angle, degree, 0 degrees at 12 o’clock, CW)
- double &lat2out : OUT (Latitude, degree)
- double &lon2out : OUT (Latitude, degree)
Return Value
Section titled “Return Value”None
calcAzimuth
Section titled “calcAzimuth”Prototype
Section titled “Prototype”double calcAzimuth( double Lat1, double Long1, double Lat2, double Long2 )Function
Section titled “Function”Compute azimuths based on north-south directions between two latitudes and longitudes.
Parameters
Section titled “Parameters”- double Lat1 : IN (Latitude, degree)
- double Long1 : IN (Longitude, degree)
- double Lat2 : IN (Latitude, degree)
- double Long2 : IN (Longitude, degree)
Return Value
Section titled “Return Value”Azimuth between two latitudes and longitudes (0 degree northward direction, CW, degree)
floatToDegStr
Section titled “floatToDegStr”Prototype
Section titled “Prototype”string_t floatToDegStr( double pos )Function
Section titled “Function”Function to convert the degree value to a string of the form xx°yy’zz”
Parameters
Section titled “Parameters”double pos : IN (Angle given as float number, degree)
Return Value
Section titled “Return Value”String of form xx°yy’zz”
Prototype
Section titled “Prototype”string_t floatToDegStr( double lat, double lon )Function
Section titled “Function”Function to convert the latitude and longitude values into a string of the form xx°yy’zz” N/S, xx°yy’zz” E/W
Parameters
Section titled “Parameters”- double lat : IN (Latitude)
- double lon : IN (Longitude)
Return Value
Section titled “Return Value”String of form xx°yy’zz” X/Y (X is N or E, Y is S or W)