Skip to content

henc · Coordinate Conversion & Misc

Coordinate conversion (Win / Map / GL / WGS84 / Mercator) and VRM / EBL utilities

int hencMapPosToWinPos( double &x, double &y )

Calculate the coordinate value of the GDI Window corresponding to the coordinate value of the coordinates of latitude/longitude on the map.

  • double &x : IN, OUT
  • IN : longitude(degree)
  • OUT : The x coordinate value of the GDI Pixel
  • double &y: IN, OUT
  • IN : latitude(degree)
  • OUT : The y coordinate value of the GDI Pixel
  • = 0 : Success
  • < 0 : Fail

int hencWinPosToMapPos( double &x, double &y )

Calculates the coordinate value on the map corresponding to the Window GDI coordinate value.

  • double &x : IN, OUT
  • IN : X coordinate of GDI Pixel
  • OUT : longitude(degree)
  • double &y: IN, OUT
  • IN : Y coordinate of GDI Pixel
  • OUT : latitude(degree)
  • = 0 : Success
  • < 0 : Fail

int hencMapPosToGlPos( double &x, double &y )

Calculate the OpenGL coordinate value set in the library corresponding to the coordinate value of the latitude and longitude on the map.

  • x : IN, OUT
  • IN : longitude(degree)
  • OUT : X coordinate value of OpenGL Viewport
  • y: IN, OUT
  • IN : latitude(degree)
  • OUT : Y coordinate value of OpenGL Viewport
  • = 0 : Success
  • < 0 : Fail

int hencGlPosToMapPos( double &x, double &y )

Calculates the map coordinate value corresponding to the OpenGL coordinate value set in the library.

  • double &x : IN, OUT
  • IN : X coordinate value of OpenGL Viewport
  • OUT : longitude(degree)
  • double &y: IN, OUT
  • IN : Y coordinate value of OpenGL Viewport
  • OUT : latitude(degree)
  • = 0 : Success
  • < 0 : Fail

int hencWinPosToGlPos( double &x, double &y )

Calculate the library setting OpenGL coordinate value corresponding to GDI Pixel coordinate value.

  • double &x : IN, OUT
  • IN : X coordinate of GDI Pixel
  • OUT : X coordinate of OpenGL Viewport
  • double &y: IN, OUT
  • IN : Y coordinate of GDI Pixel
  • OUT : Y coordinate of OpenGL Viewport
  • = 0 : Success
  • < 0 : Fail

int hencGlPosToWinPos( double &x, double &y )

Calculates the GDI pixel coordinate value corresponding to the OpenGL coordinate value set in the library.

  • double &x : IN, OUT
  • IN : X coordinate value of OpenGL Viewport
  • OUT : X coordinate value in GDI pixel
  • double &y: IN, OUT
  • IN : Y coordinate value of OpenGL Viewport
  • OUT : X coordinate value in GDI pixel
  • = 0 : Success
  • < 0 : Fail

double hencWgs84ToMercator( double lat )

Calculate the Mercator projection coordinate value corresponding to the WGS84 latitude value.

double lat : IN (WGS84 latitude, degree)

Mercator projection coordinate (latitude. degree)


double hencMercatorToWgs84( double mercator_y )

Calculates the WGS84 latitude value corresponding to the Mercator projection coordinate value.

double mercator_y : IN, Coordinate by Mecator projection. (latitude, degree)

Coordinate by WGS84 projection (latitude. degree)


void hencDrawVRM( double cx, double cy, double radius, int resoultion = 360 )

VRM(Variable Range Marker) As a drawing function, draw a polygon that connects points of the same distance with respect to the center point.

  • double cx : IN (Center Longitude, degree)
  • double cy : IN (Center Latitude, degree)
  • double radius : IN (Distance from center, meter)
  • int resolution : IN (Number of faces of polygon)

None


void hencDrawEBL( double cx, double cy, double bearing, double radius1, double radius2 )

EBL(Electronic Bearing Line) drawing function

  • double cx : IN (Center point longitude, degree)
  • double cy : IN (Center point latitude, degree)
  • double bearing : IN (Angle. 0 degree northward direction, CW, degree)
  • double radius1 : IN (Distance from the center point to the starting point of the EBL, meter)
  • double radius2 : IN (Distance from the center point to the end point of the EBL, meter)

None