## 3 Materials and Methods
### Materials
#### 3.2.2 Identification of Hand Movements  
The X, Y, and Z coordinates of the wrist and the distal phalanx from the middle finger were computed as follows to obtain geometric features (i.e., angles of ROM--range of motion):  
For extension and flexion movements:  
* First, the vector \(\overrightarrow{\textit{finger}_{Y,Z}-\textit{wrist}_{Y,Z}}\) is computed: \[\overrightarrow{\textit{finger}_{Y,Z}-\textit{wrist}_{Y,Z}}= \overrightarrow{\textit{finger}_{Y,Z}}-\overrightarrow{\textit{wrist}_{Y,Z}}\] (1) where \(\overrightarrow{\textit{finger}_{Y,Z}}\) is a vector composed of the Y and Z coordinates of the middle finger's distal phalanx position with respect to the LMC. This was obtained using the TipPosition function from the LMC API (Application Programming Interface). \(\overrightarrow{\textit{wrist}_{Y,Z}}\) is a vector composed of the Y and Z coordinates of the wrist position with respect to the LMC. This was obtained via the WristPosition function from the LMC API. The X axis was not considered for these hand movements.
* Second, the ROM angle is computed as follows: \[\textbf{ROM0}=\frac{\textbf{180}}{\pi}\cdot\textbf{arccos}\left(\frac{ \overrightarrow{z}\cdot\overrightarrow{\textit{finger}_{Y,Z}-\textit{wrist}_ {Y,Z}}}{\left|\overrightarrow{z}\right|\left|\overrightarrow{\textit{ finger}_{Y,Z}-\textit{wrist}_{Y,Z}}\right|}\right)\] (2) where \(\overrightarrow{z}\) is the vector \(=[\textbf{0}\ \textbf{1}]\), \(\pi\) is 3.145...  
For ulnar and radial deviations:  
* First, the vector \(\overrightarrow{\textit{finger}_{X,Z}-\textit{wrist}_{X,Z}}\) is computed: \[\overrightarrow{\textit{finger}_{X,Z}-\textit{wrist}_{X,Z}}= \overrightarrow{\textit{finger}_{X,Z}}-\overrightarrow{\textit{wrist}_{X,Z}}\] (3) where \(\overrightarrow{\textit{finger}_{X,Z}}\) is a vector composed of the X and Z coordinates of the middle finger; and \(\overrightarrow{\textit{wrist}_{X,Z}}\) is a vector composed of the X and Z coordinates of the wrist. The Y axis was not considered for these hand movements.
* Second, the ROM angle is computed:  
Figure 2: Hand movements used to play the game stages.  
\[\text{ROM}\mathbf{\uptheta}=\frac{\mathbf{180}}{\mathbf{\pi}}\text{-}\text{arccos}\left(\frac{ \overset{\rightarrow}{z}\cdot\widehat{\textit{finger}}_{X,Z}-\textit{wrist}_{X,Z} }{\left|\overset{\rightarrow}{z}\right|\left|\widehat{\textit{finger}}_{X,Z}- \textit{wrist}_{X,Z}\right.\right|}\right) \tag{4}\]  
where \(\overset{\rightarrow}{z}\) is the vector \(=\left\{\mathbf{0}\,\mathbf{1}\right\}\), \(\pi\) is \(3.145\ldots\)
* Finally, once the ROM angle is computed, the direction function from the LMC API is used to identify the hand movements. This function retrieves a vector composed of X, Y and Z coordinates (each one has values between \(-1\) and \(1\)) corresponding to the direction that the palm is pointing with respect to the LMC. Specifically, a negative X value is associated with an ulnar deviation, whereas a positive X value corresponds to a radial deviation. Conversely, a negative Y value is associated with a flexion movement, and a positive Y value corresponds to an extension movement. For the fist movement: The \"grabStrength\" function provided in the LMC API was used to identify the fist movement. This function gives values between \(0\) (i.e., fully opened hand) and \(1\) (i.e., fully closed hand; a fist movement).