Is it possible to measure distance (in metrics) using CoreMotion (iOS)?

Previously, for measurement, we have tried to use AR technology which relies on 3D vector's position / nodes using distance formula as follows:

Code Block
let distance = sqrt(
pow(end.position.x - start.position.x, 2) +
pow(end.position.y - start.position.y, 2) +
pow(end.position.z - start.position.z, 2)
)

We wanted to know is it possible to use CoreMotion instead for measurement? Where we thought of moving our phone from point A to point B to measure the distance (less than 100cm) between these 2 points in metrics (m or cm) from it.

If not using CoreMotion or Measurement with AR, then is there any suggestion on what should I use in iOS?

Thank you
Fitness and Navigations apps commonly use what is called the "Kalman Filter" for positional updates over time.

In summary, you can use GPS to determine your position in 2D or 3D coordinate space. For the x and y position use case, you then use velocity, and acceleration to account for error in your sampling. CLLocation has a speed value, but it isn't to be used other than for informational.

So the idea here is to use CoreLocation + CMDeviceMotion data to get a better location fix. Will it get the accuracy you're looking for? No promises there.

For discussion purposes, is your iOS device free body or fixed body? I.e. in someone's hand, or on a robot where the axis won't change. If the latter where the orientation will always be the same respective to the x/y plane, you could look into using linear acceleration data with accumulation.
Is it possible to measure distance (in metrics) using CoreMotion (iOS)?
 
 
Q