title: Algorithm for positioning with Android imageView
body: <p>I am developing an application for Android to provide location within the university using the API's compass, gps and camera.</p>
  
  <p>Could also get some important data based on API's mentioned above. This is not built-in functionality to Android or Java and requires some algorithm. I need to make a calculation that results in the position (x) that a balloon should appear on the screen as the direction of the mobile user is facing.</p>
  
  <p>To perform the calculation I already have the following data:</p>
  
  <ul>
  <li>degrees: direction (degree) in which the cell phone is being directed by the user (obtained by using the compass);</li>
  <li>grausParaDestino: direction (degree) in that the balloon should be at the center of the screen (with calculations obtained from GPS points);</li>
  <li>width: width of the screen;</li>
  </ul>
  
  <p>We know that one complete revolution of the user on its axis 360 degrees total.</p>
  
  <p>I tried the calculus below, but is incorrect.</p>
  
  <pre><code>int position = Math.round (((width * grausParaDestino) / 360) + degrees);
  </code></pre>
  
  <p>I spent yesterday afternoon trying various ways of solving this calculation, but without success. If they can give me some help I appreciate it.</p>