forked from brian09088/NB-IoT-support-for-NTN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_tle.m
43 lines (35 loc) · 1.8 KB
/
test_tle.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% Create and Visualize Scenario
startTime = datetime(2024,4,11,12,0,0);
stopTime = startTime + hours(1);
sampleTime = 60; % seconds
sc = satelliteScenario(startTime,stopTime,sampleTime);
viewer = satelliteScenarioViewer(sc, ShowDetails=false);
% Define the boundaries of Taiwan
taiwanBoundaries = [...
20.5170, 118.2008; % Southwest corner
25.3000, 122.0000; % Northwest corner
25.3000, 121.3000; % Northeast corner
20.6834, 119.6000; % Southeast corner
20.5170, 118.2008 % Repeat the first point to close the polygon
];
% Create a geoshape object from the boundary coordinates
taiwanShape = geoshape(taiwanBoundaries(:, 1), taiwanBoundaries(:, 2));
% Calculate the centroid of the Taiwan boundaries
centroid = [mean(taiwanShape.Latitude), mean(taiwanShape.Longitude)];
% Calculate the azimuth angle from the satellite to the centroid of Taiwan
% Assuming the satellite is directly overhead
satelliteAzimuth = 180;
% Calculate the true anomaly based on the azimuth angle
trueanomaly = 90 - satelliteAzimuth; % Assuming 90 degrees is directly overhead
% Update the geostationary satellite parameters with the adjusted true anomaly
semimajoraxis = 35784e3; % Semi-major axis for geostationary orbit (approximately)
inclination = 0; % Inclination for geostationary orbit
eccentricity = 0; % Eccentricity for geostationary orbit
argofperiapsis = 0; % Argument of periapsis for geostationary orbit
RAAN = 0; % Right ascension of ascending node for geostationary orbit
% Create the geostationary satellite with the adjusted true anomaly
satelliteName = 'Geostationary Satellite';
sats = satellite(sc, semimajoraxis, eccentricity, inclination, RAAN, argofperiapsis, trueanomaly, 'Name', satelliteName);
% Visualize the satellite scenario
v = satelliteScenarioViewer(sc, 'ShowDetails', false);
sat(1).ShowLabel = true;