2
$\begingroup$

I am struck with a mathematical problem. I want to convert the iPhone device's attitude information which is available in one of the following forms:

  1. Quaternion
  2. Rotation Matrix
  3. Roll, Pitch and Yaw component

To, Altitude and Azimuth. Where:

  • Altitude should be between: 0 to 90 deg and / or 0 to -90 deg. which depicts the altitude of the object pointed by the device in the sky.

enter image description here

  • Azimuth between 0 to 360 deg. which depicts the direction. North being 0 deg, South being 180 deg. etc. enter image description here

I am no expert at mathematics, so guys help me in figuring out this problem. I have already posted this question in sister website without much help. Probably because it involves too much of mathematics.

Thanks & Regards,

Raj

  • 0
    In order to determine the altitude and azimuth angle of your iphone, you need define a 3D reference frame first. But even if you have the frame, I'm afraid you still are not able to get the altitude and azimuth given the attitude of your iPhone. The attitude just tell you how your iphone rotates, but can not tell you how it translates.2011-04-27
  • 0
    The attitude tells the current state of the iPhone. It tells what are the Roll, pitch and yaw component. Now, lets say that the 3D reference frame is the same as that of the iPhone's initial position, isnt it possible to find the altitude and azimuth of the object in the sky which is pointed by the device?2011-04-28
  • 0
    I guess the device, object and iphone you mentioned are the some thing, right? If you know the position of the iphone as well as the origin of the reference frame, you can calculate the azimuth and altitude of the iphone. But I don't think the attitude is helpful.2011-04-28
  • 0
    The object here is not known to me and that is what I have to find out what objects are visible if the iPhone is pointed in that direction in the sky. All I know is: 1. The attitude of the device (pitch, roll & yaw or Quaternion or Rotation Matrix). 2. The reference frame. Am I not clear yet? Thanks for your inputs and interest.2011-04-28
  • 0
    You mean you want to find out the azimuth and altitude of an object in the sky, and all the measurement device you have is an iPhone. The problem is how can you point to the direction of the object. I'm afraid the iPhone can't help.2011-04-28
  • 0
    Maybe you need some other devices to assist. For example, an 'arrow' device with one end at the origin and the other end pointing to different directions. Fix the iphone with the arrow so that you can measure the direction of the arrow. The arrow device is like a vector in $R^3$. You may rotate the 'arrow' to the direction of the object in the sky. Measure the initial and final attitude of the iphone, respectively. Then you may know the rotation of the arrow and consequently the direction of the object.2011-04-28
  • 0
    Thanks Shiyu to this discussion that I have now understood the importance of a 3D reference frame. Ok now, I do have a initial attitude and a final attitude as you have mentioned. Well, initial attitude of iPhone device will be the one with its resting position. Say Roll=0, Pitch=0 and Yaw=0 will be the reference 3D frame or the initial position of the iPhone. Now using this initial attitude and the final attitude where the iPhone has been rotated, isnt it possible to find the Altitude and Azimuth?2011-04-29
  • 2
    For example, align the vector (i.e., arrow) with x-axis initially. The vector is $v_1=[1,0,0]^T$. After a rotation, the vector is $v_2=Rv_1=[x,y,z]^T$ where $R$ is the rotation matrix. Then the altitude is $\alpha=arctan(z/\sqrt{x^2+y^2})$. The azimuth is $\beta=arctan(y/x)$.2011-04-29
  • 0
    So, pitch=0 roll=0 and yaw=0 means aligning vector with x-axis? How do we consider here the components of other axes?2011-05-02
  • 0
    @Raj: What do you mean, "the components of other axes"? Having non-zero pitch, roll, and yaw would be handled by the rotation matrix which would (probably) result in non-zero components for the x, y, and z coordinates (and thus non-zero $\alpha$ and $\beta$).2011-05-08
  • 0
    I think what @Raj was asking here is how to figure out the sign of whatever comes out of the arctangent. In computer science, this is where the `atan2` function comes in handy. You usually give it the numerator and denominator as arguments, and it figures out the correct quadrant/octant for you.2014-09-04

0 Answers 0