Odd - thanks for letting me know. I guess this is potentially something that might make sense to add to the firmware, where it could take multiple readings.
Just FYI there's a vector maths class that can make these calculations a bit tidier - especially if you maybe wanted to average a few readings : http://www.espruino.com/Vec3
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Odd - thanks for letting me know. I guess this is potentially something that might make sense to add to the firmware, where it could take multiple readings.
Just FYI there's a vector maths class that can make these calculations a bit tidier - especially if you maybe wanted to average a few readings : http://www.espruino.com/Vec3