In turn, the CoreMotion framework provides interfaces
to cull the accelerometer. The accelerometer
is used to calculate the current rotation of the device
as well as to determine in which direction the smart
mobile device is pointing (e.g., in upwards or downwards
direction). As opposed to location and heading
data, accelerometer data is not automatically pushed
by the iOS CoreMotion framework to the application.
Therefore, we had to define an application loop that
is polling this data every 1
90 seconds. On one hand,
this rate is fast enough to obtain smooth values; on
the other, it is low enough to save battery power. As
illustrated by Fig. 4, the data the accelerometer delivers
consists of three values, i.e., the accelerations
in x-, y-, and z-direction ((Apple, 2013)). Since gravity
is required for calculating in which direction a device
is pointing, but we cannot obtain this gravity directly
using the acceleration data, we had to additionally
apply a lowpass filter (Kamenetsky, 2013), i.e.,
the filter is used for being applied to the x-, y-, and
z-direction values. Thereby, the three values obtained
are averaged and filtered. In order to obtain the vertical
heading as well as the rotation of the device, we
then have to apply the following steps: First, by calculating
arcsin(z), we obtain a value between 90
and describing the vertical heading. Second, by calculating
arctan2(