- motionEvent: function(event) {
- var gravTotal =
- Math.sqrt(Math.pow(event.accelerationIncludingGravity.x, 2) +
- Math.pow(event.accelerationIncludingGravity.y, 2) +
- Math.pow(event.accelerationIncludingGravity.z, 2));
- document.getElementById("gravTotal").textContent = gravTotal.toFixed(2) + " m/s²";
- document.getElementById("gravX").textContent = event.accelerationIncludingGravity.x.toFixed(2) + " m/s²";
- document.getElementById("gravY").textContent = event.accelerationIncludingGravity.y.toFixed(2) + " m/s²";
- document.getElementById("gravZ").textContent = event.accelerationIncludingGravity.z.toFixed(2) + " m/s²";
- //document.getElementById("gravRot").textContent = event.rotationRate;
+ motionEvent: function(aEvent) {
+ var gravTotal =
+ Math.sqrt(Math.pow(aEvent.accelerationIncludingGravity.x, 2) +
+ Math.pow(aEvent.accelerationIncludingGravity.y, 2) +
+ Math.pow(aEvent.accelerationIncludingGravity.z, 2));
+ document.getElementById("gravTotal").textContent =
+ gravTotal.toFixed(2) + " m/s²";
+ document.getElementById("gravX").textContent =
+ aEvent.accelerationIncludingGravity.x.toFixed(2) + " m/s²";
+ document.getElementById("gravY").textContent =
+ aEvent.accelerationIncludingGravity.y.toFixed(2) + " m/s²";
+ document.getElementById("gravZ").textContent =
+ aEvent.accelerationIncludingGravity.z.toFixed(2) + " m/s²";
+ //document.getElementById("gravRot").textContent = aEvent.rotationRate;