Representation of Elevation and Azimuth in the plane

Hello,

I am trying to represent the position of the gps satellites in the plane, X and Y coordinates.
I use the TinyGps ++ library.

I obtain for each satellite its Azimuth (0…359) and its elevation (0…90).

My problem is when calculating with these data the position of the X and Y coordinates … especially for the elevation. I think I understand the theory, but I am not able to capture the necessary trigonometric relationships.

I have been able to represent the relationship with the azimuth well, but not so with the elevation, which comes out changed, that is, when the elevation is 90, the point does not come out in the center (coordinate origin) but where it should be 0 ( on the edge of a theoretical circle), and vice versa.

The relationships I have used are as follows:
x = elevation [i] * sin (radians (azimuth [i])
y = elevation [i] * cos (radians (azimuth [i])

gps.ellipse(satsElevation[i]*sin(radians(satsAzimuth[i])), -satsElevation[i]*cos(radians(satsAzimuth[i])), 20, 20);

Thanks and best regards!

1 Like

In programming, on a circle 0 is right , 90 is south etc.

Hello,

https://processing.org/tutorials/transform2d/

:)

3 Likes

Thanks for your answers but they are not for my question. I know this characteristic of language.
I just found the solution, it may not be the most academic, but it works.

x = (90-elevation [i]) * sin (radians (azimuth [i]))
y = (90-elevation [i] )* cos (radians (azimuth [i]))

Maybe someone can benefit from the solution.

Best regards!

2 Likes