manchego
Joined 5 years ago
Joined 5 years ago
I've previously used the formulas on this site to calculate the altitude/azimuth of the Sun and all the planets from a given lat/long/time on Earth.
On Android you can use AbsoluteOrientationSensor or deviceorientationabsolute event. These will provide a quaternion or Euler angles describing how to rotate the device from the default orientation (flat on the ground, screen up, with the top pointing north) to its current orientation.
The situation on the iPhone has almost reduced me to tears. As far as I can tell, it only provides Euler angles relative to some implementation defined reference frame, along with the actual compass heading. In practice, the Euler angles given are absolute with respect to gravity, but always treat north as the direction the phone was pointed when the first sensor reading took place. To deal with this, you can use the actual compass heading to rotate the relative orientation to the absolute orientation. But this will have problems near the poles, as the Euler angles and heading will give conflicting values. Beyond this the compass heading field is really weird. If you want to experience its behavior for yourself, take the iPhone compass app and starting from flat, rotate the phone 360 degrees through the pitch axis. Notice at what points the heading flips between its start heading and start heading+180. I bet it will surprise you!
Also, I suspect that if you plan to continue working in software, since you have experience, you maybe shouldn't worry too much about a degree from outside the US. I bet many recruiters just view a degree as a checkmark and are more interested in your work experience.