DCS World Typescript
    Preparing search index...
    interface l_coord {
        LLtoLO(
            lat: number,
            lon: number,
            alt: number,
        ): { x: number; y: number; z: number };
        LLtoMGRS(lat: number, lon: number): l_MGRS;
        LOtoLL(vec3: l_Vec3): LuaMultiReturn<[number, number, number]>;
        MGRStoLL(mgrs: l_MGRS): LuaMultiReturn<[number, number]>;
    }

    Hierarchy (View Summary)

    Index
    • Converts geographic coordinates to a local DCS world point.

      Parameters

      • lat: number

        Latitude in decimal degrees.

      • lon: number

        Longitude in decimal degrees.

      • alt: number

        Altitude in metres.

      Returns { x: number; y: number; z: number }

      Local point in DCS coordinates.

      const point = coord.LLtoLO(41.6103, 41.5997, 0);
      trigger.action.smoke(point, trigger.smokeColor.Green);
    • Converts local DCS coordinates to geographic coordinates.

      Parameters

      • vec3: l_Vec3

        Local point in metres. x is north, z is east, and y is altitude.

      Returns LuaMultiReturn<[number, number, number]>

      Latitude in degrees, longitude in degrees, and altitude in metres.

      const [latitude, longitude, altitude] = coord.LOtoLL(unit.getPoint());
      env.info(`${latitude}, ${longitude}, ${altitude} m`);
    • Converts a structured MGRS coordinate to geographic coordinates. DCS returns two Lua values; unlike LOtoLL, it does not return altitude.

      Parameters

      • mgrs: l_MGRS

        MGRS coordinate to convert.

      Returns LuaMultiReturn<[number, number]>

      Latitude and longitude in decimal degrees.

      const grid = coord.LLtoMGRS(41.6103, 41.5997);
      const [latitude, longitude] = coord.MGRStoLL(grid);
      env.info(`${latitude}, ${longitude}`);