开发者

What is the difference between "UIAccelerometer" and "CLLocationManager"?

开发者 https://www.devze.com 2022-12-28 06:05 出处:网络
What is the difference between \"UIAccelerometer\" and \"CLLocationManager\"? Both give me x, y and z axis as result.

What is the difference between "UIAccelerometer" and "CLLocationManager"? Both give me x, y and z axis as result.

UIAccelerometer

  • X -18.000
  • Y -03.500
  • Z -41.000

CLLocationManager

  • X -0.036
  • Y -0.002
  • Z -1.069

Is this information from the same sensors with different formatting? Or are there 开发者_StackOverflow中文版"real" differences?

Thanks!


UIAccelerometer tells you which way — and how hard — gravity is pulling (including acceleration due to motion, which, per Einstein's general theory of relativity, is indistinguishable from gravity).

CLLocationManager tells you where you are on the surface of the earth. It's the GPS API.

0

精彩评论

暂无评论...
验证码 换一张
取 消