简体   繁体   English

如何在Android中使用磁力计查找磁场强度

[英]How to find MagneticField Strength using magnetometer in android

I want to get Magnetic Field Strength from magnetometer of Android Device. 我想从Android设备的磁力计获取磁场强度。

Using the magnetometer of android device I can get the data of magnetic field in the form of x,y & z axis in Micro Tesla. 使用安卓设备的磁力计,我可以得到Micro Tesla中x,y和z轴形式的磁场数据。

But I don't know how to find magnetic field. 但是我不知道如何找到磁场。

Any suggestion, Idea or Sample code are appreciated. 任何建议,想法或示例代码表示赞赏。 . .

I am not sure if I am understanding your question. 我不确定我是否理解您的问题。

Do you want the absolute value of the magnetic field instead of the components? 您是否想要磁场的绝对值而不是分量? It this is the case, it is enough to calculate the module (the square root of the sum of the squared values of every component). 就是这种情况,计算模块就足够了(每个组件平方值之和的平方根)。

The facto of having three components gives you more information: Not only the magnetic field but also the direction of it. 具有三个成分的事实会为您提供更多信息:不仅磁场,而且磁场的方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM