我正在使用react-native-sensor从传感器中获取原始数据。
setUpdateIntervalForType(SensorTypes.gyroscope, 100)
gyroscope.subscribe(({ x, y, z, timestamp }) => {
let pitch = Math.atan2(-x, -z) * 180 / Math.PI;// In degrees
let roll = Math.atan2(-y, -x) * 180 / Math.PI;// In degrees
let yaw = Math.atan2(y, -z) * 180 / Math.PI;// In degrees
this.setState({pitch: pitch, roll: roll, yaw: yaw})
})
我怎么知道设备被旋转 360