Find the ENU coordinates of orbital debris with respect to a satellite, using the ECEF coordinates of the debris and the geodetic coordinates of the satellite.
First, specify the reference spheroid as WGS84 with length units measured in kilometers. For more information about WGS84, see Reference Spheroids. The units for the ellipsoidal height, ECEF coordinates, and ENU coordinates must match the units specified by the LengthUnit property of the reference spheroid.
wgs84 = wgs84Ellipsoid('kilometer');
Specify the geodetic coordinates of the local origin. In this example, the local origin is the satellite. Specify h0 as ellipsoidal height in kilometers.
lat0 = 45.9132;
lon0 = 36.7484;
h0 = 1877.7532;
Specify the ECEF coordinates of the point of interest. In this example, the point of interest is the orbital debris.
x = 5507.5289;
y = 4556.2241;
z = 6012.8208;
Then, calculate the ENU coordinates of the debris with respect to the satellite. In this example, zUp displays in scientific notation.
[xEast,yNorth,zUp] = ecef2enu(x,y,z,lat0,lon0,h0,wgs84)
xEast = 355.6013
yNorth = -923.0832
zUp = 1.0410e+03
Reverse the transformation using the enu2ecef function. In this example, the results display in scientific notation.
[x,y,z] = enu2ecef(xEast,yNorth,zUp,lat0,lon0,h0,wgs84)
x = 5.5075e+03
y = 4.5562e+03
z = 6.0128e+03