title: Finding normal vector to iOS device
body: <p>I would like to use CMAttitude to know the vector normal to the glass of the iPad/iPhone's screen (relative to the ground). As such, I would get vectors like the following:</p>
  
  <p><img src="https://i.stack.imgur.com/QjZFL.png" alt="enter image description here"></p>
  
  <p>Notice that this is different from orientation, in that I don't care how the device is rotated about the z axis. So if I was holding the iPad above my head facing down, it would read (0,-1,0), and even as I spun it around above my head (like a helicopter), it would continue to read (0,-1,0):</p>
  
  <p><img src="https://i.stack.imgur.com/9CunS.png" alt="enter image description here"></p>
  
  <p>I feel like this might be pretty easy, but as I am new to quaternions and don't fully understand the reference frame options for device motion, its been evading me all day.</p>