I'm developing a PWA using Capacitor.js, that calculates the rate of rising/falling of the device in meters per second.
I'm using Capacitor's Motion plugin, but I'm unsure how to perform the calculations to convert the devices coordinate system to the global (?) coordinate system so that I get a correct value for rising/falling regardless of the devices orientation.
Here's the information I'm seeking:
- Are there any algorithms or formulas I should use to calculate the rate of rising/falling accurately?
- How can I process the gyroscope and accelerometer data to detect the device's motion along the global vertical axis?
I would greatly appreciate any insights, algorithms, or code snippets that can help me accurately determine the rising or falling motion of the device, independent of its orientation. Thank you!