Comments (9)
Here's my understanding of it:
accelerationIncludingGravity
is supposed to represent "the acceleration of the hosting device, plus an acceleration equal and opposite to the acceleration due to gravity", so if the device is lying flat on a horizontal surface, the host device's acceleration is 0, gravity is -9.8 and therefore accelerationIncludingGravity.z
is 9.8.
In example 8, it's acceleration.z
that is -9.8, while accelerationIncludingGravity.z
would be -9.8 from acceleration.z
+ 9.8 of an acceleration equal and opposite to the acceleration due to gravity = 0.
from deviceorientation.
@rakuco Yes, you should be correct. I did not see the phrasing, and was mislead by the term including in the name. So accelerationIncludingGravity
includes the opposite of the acceleration due to gravity.
Apparently I am not the only one confused.. See MDN not including the opposite term:
Unlike DeviceMotionEvent.acceleration which compensates for the influence of gravity, its value is the sum of the acceleration of the device as induced by the user and the acceleration caused by gravity.
from deviceorientation.
We could also add a clarification: unlike the name suggests, it represents the sum of all accelerations, except the gravity.
Examples:
- {x=0, y=0, z=+9.81} when lying flat on a horizontal surface (acceleration from the underlying surface)
- {x=0, y=0, z=0} in case of free fall (the only acceleration is gravity)
from deviceorientation.
I agree this is very confusing, I had to spend some time re-learning a lot of these concepts before commenting :-)
mdn/content#6675 should make the text in MDN less confusing, while #97 adds a note to the spec that hopefully makes things a bit more clear.
We could also add a clarification: unlike the name suggests, it represents the sum of all accelerations, except the gravity.
Examples:
- {x=0, y=0, z=+9.81} when lying flat on a horizontal surface (acceleration from the underlying surface)
- {x=0, y=0, z=0} in case of free fall (the only acceleration is gravity)
I'm not so sure about this though when it comes to how precise this definition is (assuming it's supposed to be part of the normative text). If it's supposed to go into a note, I was hoping the change I mentioned above would suffice.
from deviceorientation.
We could also add a clarification: unlike the name suggests, it represents the sum of all accelerations, except the gravity.
I think "unlike the name suggests" isn't helpful. The name suggests different things to different people. But the rest of the clarification, and the example, are useful.
I presume the point is that if you had a device on the moon, you would have a different value for sitting on the ground, and if your device was sitting somewhere on a space station it would be approximately in freefall (around the earth and sun) so the value would be below the threshold of 0.1. I wonder if it's worth expanding the examples to include that?
It might also be helpful to provide an example of walking in a straight line, the phone held at a 30ΒΊ angle from horizontal...
(Example 9 also seems to be wrong: If the phone is in the vertical plane, accelerationIncludingGravity
should be { x: v^2/r, y: 9.8, z:0 }
. Do you want a separate issue for that?
from deviceorientation.
(Example 9 also seems to be wrong: If the phone is in the vertical plane,
accelerationIncludingGravity
should be{ x: v^2/r, y: 9.8, z:0 }
. Do you want a separate issue for that?
Yes, please, I feel it's easier to handle this separately.
from deviceorientation.
@jipodine @reillyeon is everyone OK with the work done here? Can we close this ticket?
from deviceorientation.
Thank you for your work, it is much clearer now, both in the spec and in MDN.
from deviceorientation.
Thanks, @jipodine, please feel free to close this issue.
from deviceorientation.
Related Issues (20)
- Automatic publishing broken due to Specberus errors HOT 6
- Broken references in DeviceOrientation Event Specification
- Broken references in DeviceOrientation Event Specification
- Remove [NoInterfaceObject] HOT 9
- Add non-normative text describing the current deviceorientationabsolute implementation status
- What is difference with Gyroscope API ? HOT 1
- Add integration with Permissions Policy HOT 7
- Set up automatic Bikeshed compilation HOT 2
- Add integration with the Permissions API HOT 3
- requestPermission() and event handling clarification HOT 10
- DeviceMotion only works once at init and return null value HOT 2
- Update to constructor operations HOT 2
- PermissionState is already defined in Permission API HOT 7
- Need to define the DeviceMotionEvent constructor HOT 4
- Move fingerprintable APIs behind permissions HOT 46
- Device motion sampling frequency HOT 2
- Convert DeviceMotionEventAcceleration/RotationRate to dictionaries HOT 1
- DeviceMotionEvent atttributes can't be null per current IDL HOT 18
- Example 9 doesn't match the situation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deviceorientation.