View Single Post
Posts: 7 | Thanked: 1 time | Joined on Nov 2012
#45
Does the stylus have any gyro sensors to report? You can make a good guess at orientation by assuming that the accelerometer is always pointing "down" as gravity is the dominant reading. Putting it through a low pass filter should give you a pretty good bearing on where "down" is relative to the device. You can then use the phone's accelerometer similarly to work out the screen orientation, and then you can work out the relative angle between the two.