Difference between revisions of "DCS func LLtoMGRS"

From DCS World Wiki - Hoggitworld.com
 
Line 48: Line 48:
 
|examples= The following will output the full returned value as a string.  
 
|examples= The following will output the full returned value as a string.  
  
     local grid = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('bobTheTarget')))
+
     local grid = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('bobTheTarget'):getPoint()))
 
     local s = grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' ' .. grid.Easting .. ' ' .. grid.Northing
 
     local s = grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' ' .. grid.Easting .. ' ' .. grid.Northing
 
     trigger.action.outText(s, 20)
 
     trigger.action.outText(s, 20)

Latest revision as of 01:11, 3 October 2022

Scripting Root

Envrioment: Mission Scripting
Function: LLtoMGRS Added with: 1.2.0
Member Of: coord
Syntax: MGRS table coord.LLtoMGRS(GeoCoord latitude , GeoCoord longitude )
Description: Returns an MGRS table from the latitude and longitude coordinates provided. Note that in order to get the MGRS coordinate from a vec3 you must first use coord.LOtoLL on it.


Return Value: MGRS table
Return Example: example table
MGRS = {
  UTMZone = string,
  MGRSDigraph = string,
  Easting = number,
  Northing = number
}
Examples: The following will output the full returned value as a string.
   local grid = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('bobTheTarget'):getPoint()))
   local s = grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' ' .. grid.Easting .. ' ' .. grid.Northing
   trigger.action.outText(s, 20)
Related Functions: Coord Functions: LLtoLO, LOtoLL, LLtoMGRS, MGRStoLL
Notes: