Skip to content

Commit

Permalink
auto publish
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Nov 18, 2024
1 parent c429ed7 commit 6a355cb
Show file tree
Hide file tree
Showing 31 changed files with 174 additions and 107 deletions.
3 changes: 1 addition & 2 deletions +matmap3d/R3.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function A = R3(x)
%% R3(x)
% rotation matrix for ECI
%% R3 rotation matrix for ECI
A = [cos(x), sin(x), 0;
-sin(x), cos(x), 0;
0, 0, 1];
Expand Down
8 changes: 4 additions & 4 deletions +matmap3d/aer2ecef.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [x,y,z] = aer2ecef(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit)
%% AER2CEF(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit)
% convert azimuth, elevation, range to target from observer to ECEF coordinates
%% AER2ECEF convert azimuth, elevation, range to target from observer to ECEF coordinates
%
%%% Inputs
%
Expand All @@ -14,7 +12,9 @@
%%% outputs
%
% * x,y,z: Earth Centered Earth Fixed (ECEF) coordinates of test point (meters)
%% sanity checks

function [x,y,z] = aer2ecef(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit)

arguments
az {mustBeReal}
el {mustBeReal}
Expand Down
6 changes: 3 additions & 3 deletions +matmap3d/aer2eci.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function [x, y, z] = aer2eci(utc, az, el, rng, lat, lon, alt)
%% aer2eci(utc, az, el, rng, lat, lon, alt)
% convert AER (azimuth, elevation, slant range) to ECI
%% AER2ECI convert AER (azimuth, elevation, slant range) to ECI
%
% NOTE: because underlying ecef2eci() is rotation only, error can be order
% 1..10%
%
Expand All @@ -11,6 +10,7 @@
%
%%% Outputs
% * x, y, z: ECI x, y, z
function [x, y, z] = aer2eci(utc, az, el, rng, lat, lon, alt)
arguments
utc datetime
az {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/aer2enu.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [e, n, u] = aer2enu (az, el, slantRange, angleUnit)
%% aer2enu(az, el, slantRange, angleUnit)
% convert azimuth, elevation, range to ENU coordinates
%% AER2ENU convert azimuth, elevation, range to ENU coordinates
%
%%% Inputs
% * az, el, slantrange: look angles and distance to point under test (degrees, degrees, meters)
Expand All @@ -10,6 +8,7 @@
%
%%% Outputs
% * e,n,u: East, North, Up coordinates of test points (meters)
function [e, n, u] = aer2enu (az, el, slantRange, angleUnit)
arguments
az {mustBeReal}
el {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/aer2geodetic.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [lat1, lon1, alt1] = aer2geodetic(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit)
%% aer2geodetic(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit)
% convert azimuth, elevation, range of target from observer to geodetic coordiantes
%% aer2geodetic convert azimuth, elevation, range of target from observer to geodetic coordiantes
%
%%% Inputs
% * az, el, slantrange: look angles and distance to point under test (degrees, degrees, meters)
Expand All @@ -12,6 +10,7 @@
%
%%% Outputs
% * lat1,lon1,alt1: geodetic coordinates of test points (degrees,degrees,meters)
function [lat1, lon1, alt1] = aer2geodetic(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit)
arguments
az {mustBeReal}
el {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/aer2ned.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [north, east, down] = aer2ned(az, el, slantRange, angleUnit)
%% aer2ned(az, el, slantRange, angleUnit)
% convert azimuth, elevation, range to NED coordinates
%% AER2NED convert azimuth, elevation, range to NED coordinates
%
%%% Inputs
% * az, el, slantrange: look angles and distance to point under test (degrees, degrees, meters)
Expand All @@ -10,6 +8,7 @@
%
%%% Outputs
% * north, east, down: coordinates of points (meters)
function [north, east, down] = aer2ned(az, el, slantRange, angleUnit)
arguments
az {mustBeReal}
el {mustBeReal}
Expand Down
6 changes: 3 additions & 3 deletions +matmap3d/ecef2aer.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [az, el, slantRange] = ecef2aer(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
%% ecef2aer(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
% convert ECEF of target to azimuth, elevation, slant range from observer
%% ECEF2AER convert ECEF of target to azimuth, elevation, slant range from observer
%
%%% Inputs
% * x,y,z: Earth Centered Earth Fixed (ECEF) coordinates of test point (meters)
Expand All @@ -12,6 +10,8 @@
% * az, el, slantrange: look angles and distance to point under test (degrees, degrees, meters)
% * az: azimuth clockwise from local north
% * el: elevation angle above local horizon
function [az, el, slantRange] = ecef2aer(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)

arguments
x {mustBeReal}
y {mustBeReal}
Expand Down
6 changes: 3 additions & 3 deletions +matmap3d/ecef2eci.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function [x,y,z] = ecef2eci(utc, x0, y0, z0)
%% ecef2eci(utc, x0, y0, z0)
% rotate ECEF coordinates to ECI
%% ECEF2ECI rotate ECEF coordinates to ECI
% because this doesn't account for nutation, etc. error is often > 1%
%
%%% Inputs
% x0, y0, z0: ECEF position (meters)
% utc: time UTC
%%% Outputs
% * x,y,z: ECI position (meters)

function [x,y,z] = ecef2eci(utc, x0, y0, z0)
arguments
utc (:,1) datetime
x0 (:,1) {mustBeReal,mustBeEqualSize(utc,x0)}
Expand Down
7 changes: 4 additions & 3 deletions +matmap3d/ecef2enu.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function [east, north, up] = ecef2enu(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
%% ecef2ned(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
% convert ECEF to NED

%% ECEF2ENU convert ECEF to ENU
%
%%% Inputs
% * x,y,z: Earth Centered Earth Fixed (ECEF) coordinates of test point (meters)
Expand All @@ -10,6 +9,8 @@
%
%%% outputs
% * East, North, Up coordinates of test points (meters)

function [east, north, up] = ecef2enu(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
arguments
x {mustBeReal}
y {mustBeReal}
Expand Down
6 changes: 3 additions & 3 deletions +matmap3d/ecef2enuv.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [e, n, Up] = ecef2enuv(u, v, w, lat0, lon0, angleUnit)
%% ecef2enuv
% convert *vector projection* UVW to ENU
%% ECEF2ENUV convert *vector projection* UVW to ENU
%
%%% Inputs
% * u,v,w: meters
Expand All @@ -9,6 +7,8 @@
%
%%% Outputs
% * e,n,Up: East, North, Up vector

function [e, n, Up] = ecef2enuv(u, v, w, lat0, lon0, angleUnit)
arguments
u {mustBeReal}
v {mustBeReal}
Expand Down
6 changes: 3 additions & 3 deletions +matmap3d/ecef2geodetic.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [lat,lon,alt] = ecef2geodetic(spheroid, x, y, z, angleUnit)
%% ecef2geodetic
% convert ECEF to geodetic coordinates
%% ECEF2GEODETIC convert ECEF to geodetic coordinates
%
%%% Inputs
% * x,y,z: ECEF coordinates of test point(s) (meters)
Expand All @@ -13,6 +11,8 @@
% based on:
% You, Rey-Jer. (2000). Transformation of Cartesian to Geodetic Coordinates without Iterations.
% Journal of Surveying Engineering. doi: 10.1061/(ASCE)0733-9453

function [lat,lon,alt] = ecef2geodetic(spheroid, x, y, z, angleUnit)
arguments
spheroid {mustBeScalarOrEmpty}
x {mustBeReal}
Expand Down
6 changes: 2 additions & 4 deletions +matmap3d/ecef2ned.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [north, east, down] = ecef2ned(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
%% ecef2enu
% convert ECEF to ENU
%% ECEF2NED Convert ECEF coordinates to NED
%
%%% Inputs
% * x,y,z: Earth Centered Earth Fixed (ECEF) coordinates of test point (meters)
Expand All @@ -10,7 +8,7 @@
%
%%% outputs
% * North,East,Down: coordinates of points (meters)

function [north, east, down] = ecef2ned(x, y, z, lat0, lon0, alt0, spheroid, angleUnit)
arguments
x {mustBeReal}
y {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/eci2aer.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [az, el, rng] = eci2aer(utc, x0, y0, z0, lat, lon, alt)
%% eci2aer(utc, x0, y0, z0, lat, lon, alt)
% convert ECI to AER (azimuth, elevation, slant range)
%% ECI2AER convert ECI to AER (azimuth, elevation, slant range)
%
% parameters:
% utc: datetime UTC
Expand All @@ -9,6 +7,7 @@
%
% outputs:
% az,el,rng: Azimuth (degrees), Elevation (degrees), Slant Range (meters)
function [az, el, rng] = eci2aer(utc, x0, y0, z0, lat, lon, alt)
arguments
utc datetime
x0 {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/eci2ecef.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
function [x,y,z] = eci2ecef(utc, x_eci, y_eci, z_eci)
%% eci2ecef(utc, x_eci, y_eci, z_eci)
% rotate ECI coordinates to ECEF
%% ECI2ECEF rotate ECI coordinates to ECEF
% because this doesn't account for nutation, etc. error is often > 1%
%
% x_eci, y_eci, z_eci: eci position vectors
% utc: Matlab datetime UTC
%
% x,y,z: ECEF position (meters)
function [x,y,z] = eci2ecef(utc, x_eci, y_eci, z_eci)
arguments
utc (:,1) datetime
x_eci (:,1) {mustBeReal,mustBeEqualSize(utc,x_eci)}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/enu2aer.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [az, elev, slantRange] = enu2aer(east, north, up, angleUnit)
%% enu2aer
% convert ENU to azimuth, elevation, slant range
%% ENU2AER convert ENU to azimuth, elevation, slant range
%
%%% Inputs
% * e,n,u: East, North, Up coordinates of test points (meters)
Expand All @@ -10,6 +8,7 @@
% * az, el, slantrange: look angles and distance to point under test (degrees, degrees, meters)
% * az: azimuth clockwise from local north
% * el: elevation angle above local horizon
function [az, elev, slantRange] = enu2aer(east, north, up, angleUnit)
arguments
east {mustBeReal}
north {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/enu2ecef.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [x, y, z] = enu2ecef(east, north, up, lat0, lon0, alt0, spheroid, angleUnit)
%% enu2ecef
% convert from ENU to ECEF coordiantes
%% ENU2ECEF convert from ENU to ECEF coordiantes
%
%%% Inputs
% * east, north, up: coordinates of test points (meters)
Expand All @@ -10,6 +8,7 @@
%
%%% outputs
% * x,y,z: Earth Centered Earth Fixed (ECEF) coordinates of test point (meters)
function [x, y, z] = enu2ecef(east, north, up, lat0, lon0, alt0, spheroid, angleUnit)
arguments
east {mustBeReal}
north {mustBeReal}
Expand Down
5 changes: 3 additions & 2 deletions +matmap3d/enu2ecefv.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function [u, v, w] = enu2ecefv(east, north, up, lat0, lon0, angleUnit)
%% enu2ecef convert from ENU to ECEF coordinates
%% ENU2ECEFV convert from ENU to ECEF coordinates
%
%%% Inputs
% * e,n,u: East, North, Up coordinates of point(s) (meters)
Expand All @@ -8,6 +7,8 @@
%
%%% outputs
% * u,v,w: coordinates of test point(s) (meters)

function [u, v, w] = enu2ecefv(east, north, up, lat0, lon0, angleUnit)
arguments
east {mustBeReal}
north {mustBeReal}
Expand Down
5 changes: 3 additions & 2 deletions +matmap3d/enu2geodetic.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function [lat, lon, alt] = enu2geodetic(east, north, up, lat0, lon0, alt0, spheroid, angleUnit)
%% enu2geodetic convert from ENU to geodetic coordinates
%% ENU2GEODETIC convert from ENU to geodetic coordinates
%
%%% Inputs
% * east,north,up: ENU coordinates of point(s) (meters)
Expand All @@ -9,6 +8,8 @@
%
%%% outputs
% * lat,lon,alt: geodetic coordinates of test points (degrees,degrees,meters)

function [lat, lon, alt] = enu2geodetic(east, north, up, lat0, lon0, alt0, spheroid, angleUnit)
arguments
east {mustBeReal}
north {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/enu2uvw.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

function [u,v,w] = enu2uvw(east,north,up,lat0,lon0,angleUnit)
%% enu2uvw convert from ENU to UVW coordinates
%% ENU2UVW convert from ENU to UVW coordinates
%
%%% Inputs
% * e,n,up: East, North, Up coordinates of point(s) (meters)
Expand All @@ -9,6 +7,7 @@
%
%%% outputs
% * u,v,w: coordinates of test point(s) (meters)
function [u,v,w] = enu2uvw(east,north,up,lat0,lon0,angleUnit)
arguments
east {mustBeReal}
north {mustBeReal}
Expand Down
5 changes: 3 additions & 2 deletions +matmap3d/geodetic2aer.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [az, el, slantRange] = geodetic2aer(lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit)
%% geodetic2aer

%% GEODETIC2AER converts geodetic coordinates to azimuth, elevation, slant range
% from an observer's perspective, convert target coordinates to azimuth, elevation, slant range.
%
%%% Inputs
Expand All @@ -12,6 +12,7 @@
% * az, el, slantrange: look angles and distance to point under test (degrees, degrees, meters)
% * az: azimuth clockwise from local north
% * el: elevation angle above local horizon
function [az, el, slantRange] = geodetic2aer(lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit)
arguments
lat {mustBeReal}
lon {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/geodetic2ecef.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [x,y,z] = geodetic2ecef(spheroid, lat, lon, alt, angleUnit)
%% geodetic2ecef
% convert from geodetic to ECEF coordiantes
%% GEODETIC2ECEF convert from geodetic to ECEF coordiantes
%
%%% Inputs
% * lat,lon, alt: ellipsoid geodetic coordinates of point(s) (degrees, degrees, meters)
Expand All @@ -9,6 +7,7 @@
%
%%% outputs
% * x,y,z: ECEF coordinates of test point(s) (meters)
function [x,y,z] = geodetic2ecef(spheroid, lat, lon, alt, angleUnit)
arguments
spheroid {mustBeScalarOrEmpty}
lat {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/geodetic2enu.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function [east, north, up] = geodetic2enu(lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit)
%% geodetic2enu
% convert from geodetic to ENU coordinates
%% GEODETIC2ENU convert from geodetic to ENU coordinates
%
%%% Inputs
% * lat,lon, alt: ellipsoid geodetic coordinates of point under test (degrees, degrees, meters)
Expand All @@ -10,6 +8,7 @@
%
%%% outputs
% * east,north,up: coordinates of points (meters)
function [east, north, up] = geodetic2enu(lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit)
arguments
lat {mustBeReal}
lon {mustBeReal}
Expand Down
5 changes: 2 additions & 3 deletions +matmap3d/get_radius_normal.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
function N = get_radius_normal(lat, E)
%% get_radius_normal
% normal along the prime vertical section ellipsoidal radius of curvature
%% GET_RADIUS_NORMAL normal along the prime vertical section ellipsoidal radius of curvature
%
%%% Inputs
% * lat: geodetic latitude in Radians
% * ell: referenceEllipsoid
%
%%% Outputs
% * N: normal along the prime vertical section ellipsoidal radius of curvature, at a given geodetic latitude.
function N = get_radius_normal(lat, E)
arguments
lat {mustBeReal}
E (1,1) matmap3d.referenceEllipsoid
Expand Down
4 changes: 2 additions & 2 deletions +matmap3d/greenwichsrt.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function gst = greenwichsrt(Jdate)
%% greenwichsrt(Jdate)
%% GREENWICHSRT Compute greenwich sidereal time from Julian date
% compute greenwich sidereal time from D. Vallado 4th edition
%
%%% Inputs
% Jdate: Julian days from Jan 1, 4713 BCE from juliantime(utc) or juliandate(utc)
%%% Outputs
% gst: greenwich sidereal time [0, 2pi)
function gst = greenwichsrt(Jdate)
arguments
Jdate {mustBeReal,mustBeNonnegative}
end
Expand Down
3 changes: 1 addition & 2 deletions +matmap3d/lookAtSpheroid.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

function [lat, lon, d] = lookAtSpheroid(lat0, lon0, h0, az, tilt, spheroid, angleUnit)
%% LOOKATSPHEROID
% Calculates line-of-sight intersection with Earth (or other ellipsoid) surface from above surface ./ orbit
%
Expand All @@ -18,6 +16,7 @@
% Algorithm based on:
% https://medium.com/@stephenhartzell/satellite-line-of-sight-intersection-with-earth-d786b4a6a9b6
% Stephen Hartzell
function [lat, lon, d] = lookAtSpheroid(lat0, lon0, h0, az, tilt, spheroid, angleUnit)
arguments
lat0 {mustBeReal}
lon0 {mustBeReal}
Expand Down
Loading

0 comments on commit 6a355cb

Please sign in to comment.