Closed OrbitTheSun closed 5 years ago
Hi, I did something like you, calculate the Range, Azimuth and Elevation! https://github.com/dragonyzl/dump1090/tree/RAE_UDP
I don't think your maths is right here. You can't assume a flat earth for anything other than short ranges.
@dragonyzl 's conversion looks more correct, transforming to ENU is the way to do it (but the implementation is massive overkill)
Hi all, you're right, assuming a flat earth for computing the elevation is a simplification. But the error is small and the calculation of distance and elevation is a two-liner. I checked the error for a plane with 100 km ground distance and 10 km altitude. Its below one degree. The values are:
Correct elevation: 5.256 degrees Flat earth calculation: 5.71 degrees
Correct distance: 100.5758 km Flat earth calculation: 100.499 km
The elevation and air distance values should only be considered as a hint where to look and how far the plane actually is in the sky. Thus the plane is moving, no arc minute accuracy is needed.
But there is a bigger error source and this is because the observers altitude is not considered. So sea level is assumed. Perhaps one could add a command line parameter to enter site altitude into the equation.
Greetings Andreas
I added URL parameters lat, lon and height to set the site position individually for each client. Observer height can also be set alone / additionally.
Air distance and elevation are now calculated exactly. The height of the observer and the shape of the earth are taken into account.
I would find this useful, especially if the numbers are now accurate :)
I added output for air distance and elevation of a selected plane. The table has a new column "Elev." which can be sorted as well. Maximum elevation and minimum air distance are displayed when seen.