Best way to calculate elliptical trajectory

3 ビュー (過去 30 日間)
hal9k
hal9k 2021 年 6 月 1 日
コメント済み: Adam Danz 2021 年 6 月 3 日
How do I calculate the ellptical trajectory on a spheroid at constant altitude if I know the center of ellipse and boundary points of imaginary rectangle?
% earth ref spheroid
wgs84 = wgs84Ellipsoid;
% Aircraft location
lat_aircraft = 45; %deg
lon_aircraft = 8; %deg
alt_aircraft = 5000; %m
%% Receiver extent
lon_extent = 0.5;
lat_extent = 1;
%% Find boundry points of rectangle, and add center of the location
lat_range = [lat_aircraft - (lat_extent/2), lat_aircraft, lat_aircraft + (lat_extent/2)];
lon_range = [lon_aircraft - (lon_extent/2), lon_aircraft, lon_aircraft + (lon_extent/2)];
latlonPts = [combvec(lat_range, lon_range)]';
geoplot(latlonPts(:,1), latlonPts(:,2),'*')
%% Create elliptical traj at constant altitude

回答 (1 件)

Adam Danz
Adam Danz 2021 年 6 月 1 日
編集済み: Adam Danz 2021 年 6 月 2 日
Existing code
% earth ref spheroid
wgs84 = wgs84Ellipsoid;
% Aircraft location
lat_aircraft = 45; %deg
lon_aircraft = 8; %deg
alt_aircraft = 5000; %m
%% Receiver extent
lon_extent = 0.5;
lat_extent = 1;
%% Find boundry points of rectangle, and add center of the location
lat_range = [lat_aircraft - (lat_extent/2), lat_aircraft, lat_aircraft + (lat_extent/2)];
lon_range = [lon_aircraft - (lon_extent/2), lon_aircraft, lon_aircraft + (lon_extent/2)];
latlonPts = [combvec(lat_range, lon_range)]';
geoplot(latlonPts(:,1), latlonPts(:,2),'*')
Create ellipse within bounding box
%% Create elliptical traj at constant altitude
theta = linspace(0,2*pi) ;
x = lon_extent/2 * cos(theta) + lon_aircraft;
y = lat_extent/2 * sin(theta) + lat_aircraft;
hold on
geoplot(y,x,'r-')
  1 件のコメント
Adam Danz
Adam Danz 2021 年 6 月 3 日
Note, the simple solution above works when the rectangle is parallel with the axes but does not work with rotated rectangles.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCoordinate Systems についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by