CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

Geodesy.geodeticToLocalEnu

Project a geodetic point into the origin's East-North-Up frame

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputoriginGeodeticOriginLocal frame reference point
inputlat_degRealTarget latitude [deg]
inputlon_degRealTarget longitude [deg]
inputalt_mRealTarget altitude above the datum [m]
inputearth_radius_mReal= 6378137.0Spherical Earth radius [m]
outputenu_mReal[3]East, north, and up displacement [m]

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function geodeticToLocalEnu
    "Project a geodetic point into the origin's East-North-Up frame"
    input GeodeticOrigin origin "Local frame reference point";
    input Real lat_deg "Target latitude [deg]";
    input Real lon_deg "Target longitude [deg]";
    input Real alt_m "Target altitude above the datum [m]";
    input Real earth_radius_m = 6378137.0 "Spherical Earth radius [m]";
    output Real enu_m[3] "East, north, and up displacement [m]";
  protected
    Real north_east_m[2];
  algorithm
    north_east_m := latLonToLocalNorthEast(
      origin.latitude_deg, origin.longitude_deg, lat_deg, lon_deg,
      earth_radius_m);
    enu_m := {north_east_m[2], north_east_m[1], alt_m - origin.altitude_m};
  end geodeticToLocalEnu;