title: iOS - Calculating distance, azimuth, elevation and relative position (Augmented Reality)
body: <p>I am starting to build an augmented reality app where you can place an image on the screen on your augmented reality camera view and it stays in that position on the Earth, so someone else with their camera view can come by and see it on the augmented reality camera view. For this I know I need to calculate some sort of distance factor along with azimuth and elevation. </p>
  
  <p>So, I have already figured out how to send the object's graphics up to a server and retrieve it back, but how can I place it back on its original position, relative to Earth. I know I need to calculate its:</p>
  
  <ul>
  <li>Altitude</li>
  <li>Coordinates</li>
  <li>Azimuth</li>
  <li>Elevation</li>
  <li>Distance </li>
  </ul>
  
  <p>But how would I calculate these and account for them/piece them together. I hope you understand what I mean.</p>
  
  <p>To refine your understanding let me give you a short demo of the app:</p>
  
  <p>A man is in his house, he decides to place an image of a painting on one of his walls. He opens up the app which defaults to the augmented reality screen, he presses the plus button and adds an image from his photo library. Behind the scenes, it saves the location and positional data up to a server, someone with the app and its augmented reality screen comes by, it goes up to the server and finds images saved nearby, it then downloads the image and places it up on the wall so the other man can see it with his phone when he moves it by.</p>
  
  <p>What approach should I take to achieve this? Any outline, links, resources, tutorials, thoughts, experience etc. Thanks! This was a generally hard question to write down, I hope you can understand. If not please tell me and I will reword.</p>
  
  <p>Rohan</p>