Magnetic Field Events: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
No edit summary
mNo edit summary
Line 5: Line 5:
The [[#DeviceMagneticFieldEvent_Interface|DeviceMagneticFieldEvent]] interface provides web developers information about the magnetic field near the hosting device.  
The [[#DeviceMagneticFieldEvent_Interface|DeviceMagneticFieldEvent]] interface provides web developers information about the magnetic field near the hosting device.  


This is achieved by interrogating a magnetic field sensor or similar detectors of a device.  
This is achieved by interrogating a magnetic field sensor or similar detectors of a device.
 
Magnetic field sensor is a device that detects the '''''current device magnetic field'''''.


== Conformance  ==
== Conformance  ==
Line 25: Line 27:
The concepts '''''[http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#constructing-events create an event]''''' and '''''[http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#firing-events fire an event]''''' are defined in [DOM4].
The concepts '''''[http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#constructing-events create an event]''''' and '''''[http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#firing-events fire an event]''''' are defined in [DOM4].


The '''''current device magnetic field''''' is the magnetic field intensity vector near the hosting device. It is represented by three components ''x'', ''y'' and ''z'' in X, Y and -Z axis of the device coordinate system in micro-Tesla (uT) unit.
The '''''current device magnetic field''''' is the magnetic field vector near the hosting device. It is represented by three components ''x'', ''y'' and ''z'' in X, Y and -Z axis of the device coordinate system in micro-Tesla (uT) unit.


NOTE
NOTE
:The magnetic field's Z axis is inverted.
:The magnetic field's Z axis is inverted.


The '''''[http://developer.android.com/reference/android/hardware/SensorListener.html device coordinate system'''''] is a orthogonal coordinate system in which the X axis refers to the screen's horizontal axis (the small edge in portrait mode, the long edge in landscape mode) and points to the right, the Y axis refers to the screen's vertical axis and points towards the top of the screen (the origin is in the lower-left corner), and the Z axis points toward the sky when the device is lying on its back on a table.
The '''''[http://developer.android.com/reference/android/hardware/SensorEvent.html device coordinate system'''''] is a orthogonal coordinate system in which the X axis refers to the screen's horizontal axis (the small edge in portrait mode, the long edge in landscape mode) and points to the right, the Y axis refers to the screen's vertical axis and points towards the top of the screen (the origin is in the lower-left corner), and the Z axis points toward the sky when the device is lying on its back on a table.


NOTE
NOTE
Line 54: Line 56:


  [Constructor (DOMString type, optional DeviceMagneticFieldEventInit eventInitDict)]
  [Constructor (DOMString type, optional DeviceMagneticFieldEventInit eventInitDict)]
  interface DeviceMagneticFieldEvent : Event {
  interface DeviceMagneticFieldEvent : Event {
     readonly attribute double x;
     readonly attribute double x;
     readonly attribute double y;
     readonly attribute double y;
Line 60: Line 62:
  };
  };


  dictionary DeviceMagneticFieldEventInit : EventInit {
  dictionary DeviceMagneticFieldEventInit : EventInit {
     double x;
     double x;
     double y;
     double y;
Line 70: Line 72:
'''x''' of type double, readonly  
'''x''' of type double, readonly  


:Ambient magnetic field in the X axis of the device coordinate system in uT.
:Ambient magnetic field in the X axis of the device coordinate system in uT. Ranged from -∞ to +∞.


'''y''' of type double, readonly  
'''y''' of type double, readonly  


:Ambient magnetic field in the Y axis of the device coordinate system in uT.
:Ambient magnetic field in the Y axis of the device coordinate system in uT. Ranged from -∞ to +∞.


'''z''' of type double, readonly  
'''z''' of type double, readonly  


:Ambient magnetic field in the -Z axis of the device coordinate system in uT.
:Ambient magnetic field in the -Z axis of the device coordinate system in uT. Ranged from -∞ to +∞.


==== Dictionary DeviceMagneticFieldEventInit Members  ====
==== Dictionary DeviceMagneticFieldEventInit Members  ====
Confirmed users
19

edits

Navigation menu