@marcoscaceres sorry I missed the original post. `Compass` & `Magnetometer` in J5 don't expose raw xyz magnetometer data (though they surely could), because generally the developer really just wants a heading in degrees, which is be computed from x and y. ``` let heading = Math.atan2(y, x); let pi_2 = Math.PI * 2; if (heading < 0) { heading += pi_2; } if (heading > pi_2) { heading -= pi_2; } let degrees = heading * (180 / Math.PI); ``` I view that as an undue burden on the developer. For true-north heading, just subtract a declination angle. The **z** in x, y, z is used for computing the earth's magnetic field—I've written a robot that can navigate from any lat/lon point to any _other_ lat/lon point using a gps and compass/magnetometer—no **z** necessary. -- GitHub Notification of comment by rwaldron Please view or discuss this issue at https://github.com/w3c/magnetometer/issues/3#issuecomment-248446835 using your GitHub accountReceived on Tuesday, 20 September 2016 21:55:23 UTC
This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:52 UTC