Closed fgnievinski closed 6 months ago
I have also removed the definitions of default constants because it should be done in only one place to avoid bugs due to inconsistency -- indeed, here we had Ht = 20e6
while in get_satellite_height.m we had a different value: Ht = 20.2e6;
https://github.com/vitorhjr/geo-alhazen/blob/main/geo-alhazen-aux/get_satellite_height.m
I've tried to normalize radii to values closer to 1 to avoid overflow when squaring, R^2:
R0 = Rs;
Ra = Ra./R0;
Rt = Rt./R0;
Rs = Rs./R0; %=1
I split the function get_geocentric_angle
into two new functions following the suggestions above:
I updated the usages of the get_geocentric_angle
inside the functions.
The two new functions were tested and presented the expected results.
It was interesting that the normalized radii method generated better results than the older version when compared to the vectorial method.
the calculation of the two geocentric angles is completely unrelated, they should not be part of the same function.
and we don't need to calculate both when the user only needs one.
https://github.com/vitorhjr/geo-alhazen/blob/main/geo-alhazen-aux/get_geocentric_angle.m