# Representation of Elevation and Azimuth in the plane

**URL:** https://discourse.processing.org/t/representation-of-elevation-and-azimuth-in-the-plane/20730
**Category:** Libraries
**Created:** [May 10, 2020, 11:29pm UTC](https://discourse.processing.org/t/representation-of-elevation-and-azimuth-in-the-plane/20730 "2020-05-10T23:29:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jcduino](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jcduino](https://discourse.processing.org/u/jcduino)
#### Post date: [May 10, 2020, 11:29pm UTC](https://discourse.processing.org/t/representation-of-elevation-and-azimuth-in-the-plane/20730/1 "2020-05-10T23:29:27Z")

</div>

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])

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

```

Thanks and best regards!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [May 10, 2020, 11:49pm UTC](https://discourse.processing.org/t/representation-of-elevation-and-azimuth-in-the-plane/20730/2 "2020-05-10T23:49:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [May 11, 2020, 12:25am UTC](https://discourse.processing.org/t/representation-of-elevation-and-azimuth-in-the-plane/20730/3 "2020-05-11T00:25:45Z")

</div>

Hello,

[https://processing.org/tutorials/transform2d/](https://processing.org/tutorials/transform2d/)  
[![](https://processing.org/tutorials/transform2d/imgs/degrees.png) ](https://processing.org/tutorials/transform2d/imgs/degrees.png)

`:)`

---

<div class="post-metadata">

### Author: ![jcduino](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jcduino](https://discourse.processing.org/u/jcduino)
#### Post date: [May 11, 2020, 11:34pm UTC](https://discourse.processing.org/t/representation-of-elevation-and-azimuth-in-the-plane/20730/4 "2020-05-11T23:34:56Z")

</div>

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!
