Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you bound to old 3.x devices or can you rely on iOS 4.x? In general the "old" UIAccelerometerDelegate will be deprecated soon because it is replaced by new Core Motion framework (s. <a href="https://stackoverflow.com/questions/6742531/why-is-accelerometerdidaccelerate-deprecated-in-ios5">Why is accelerometer:didAccelerate: deprecated in IOS5?</a>)</p> <p>Next, you are talking about iPad which has IMO a gyroscope (or is it iPad 2 only?). If you can rely on devices having one, you are done with Core Motion DeviceMotion which provides Euler angles ready to use without any problems (OK bear in mind Gimbal lock). See <a href="https://stackoverflow.com/questions/5214197/simple-iphone-motion-detect/5220796#5220796">Simple iPhone motion detect</a> especially:</p> <ul> <li><a href="http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMMotionManager_Class/Reference/Reference.html#//apple_ref/occ/instm/CMMotionManager/startDeviceMotionUpdatesToQueue:withHandler:" rel="nofollow noreferrer">CMMotionManager startDeviceMotionUpdatesToQueue:withHandler:</a></li> <li><a href="http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMMotionManager_Class/Reference/Reference.html#//apple_ref/c/tdef/CMDeviceMotionHandler" rel="nofollow noreferrer">CMDeviceMotionHandler</a></li> <li><a href="http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMDeviceMotion_Class/Reference/Reference.html#//apple_ref/doc/c_ref/CMDeviceMotion" rel="nofollow noreferrer">CMDeviceMotion attitude</a></li> <li><a href="http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMAttitude_Class/Reference/Reference.html#//apple_ref/occ/cl/CMAttitude" rel="nofollow noreferrer">CMAttitude pitch</a></li> <li><a href="http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html#//apple_ref/doc/uid/TP40009541-CH4-SW4" rel="nofollow noreferrer">Event Handling Guide for iOS / Handling Processed Device-Motion Data</a></li> </ul> <p>You can check out WWDC2010 sample code: <a href="https://stackoverflow.com/questions/3111855/wwdc-2010-sample-code">WWDC 2010 Sample Code</a></p> <p>If not, any chance to convince you or your business partners? OK, you are still there :-) hmmh, atan and atan2 have some discontinuities, are you sure that it works out for all combinations of small x and y values i.e. if the device is lying on the table without or with just small motion but some sensor noise?</p> <p>Regarding perfomance: Yes atan is quite expensive so you can check out using alternatives like <a href="http://pierre.chachatelier.fr/programmation/cpp-fastmath.php" rel="nofollow noreferrer">FastMath.h</a> (it's in French but no worries follow the link at <em>C++ en un simple fichier header FastMath.h contenant</em>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload