Gradient in a triangle, unclear notation. I'm reading through a mesh processing book, more specifically conformal parameterization.
A snippet is reported below:

Conformality can be expressed as a relation between the gradients of parameterization. Therefore, to port the definition of conformal maps into the setting of piecewise linear triangulated surfaces, one can use the expression of the gradients as given in Section 3.3.
  However we need to stress again that our setting is slightly different from the one in Chapter 3. In our case, the 3D surface is given, and our coal is to construct the parameterization. In this setting, it seems more natural to characterize the inverse of the parameterization, i.e. the function that goes from the 3D surface $S$ (known) to the parameter space $\Omega$. This function is also piecewise linear. In this configuration, to define the gradients it is possible to provide each triangle with an orthonormal $X,Y$, as shown in Figure 5.9 (we can use one of the vertices $x_i$ of the triangle as origin. In this basis, we can stude the inverse of the parameterization - that is to say, the function that maps a point $(X,Y)$ of the triangle to a point $(u,v)$ in the parameter space. The gradients of this function are given by...

The picture is the one below and below this there's the expression of the gradient.


$A_T$ is the area of the triangle and the matrix $M_T$ is constant, nothing is said about the symbols inside and what they mean but I assume they're related to the triangle points respect to the basis $X,Y$ but I might be wrong...
Can anyone clarify how that gradient might be computed?
 A: We have an orthonormal coordinate system on the plane of the triangle $T$ defined by the unit vectors $\mathbf X$ and $\mathbf Y$, and posit an affine map $\phi$ from this coordinate system to the parameter space such that the three vertices of $T$ are mapped as $\phi(X_i,Y_i)=(u_i,v_i)$, $\phi(X_j,Y_j)=(u_j,v_j)$ and $\phi(X_k,Y_k)=(u_k,v_k)$. We will also need the fact that the map between the $X$-$Y$ coordinate system and the standard one is an orientation-preserving isometry.  
I find it easiest to work out the gradients $\nabla u$ and $\nabla v$ by looking at the map $\phi$ as a whole. Relative to the coordinate systems that we’re working with $\phi$ can be expressed in matrix form as $$\phi: \begin{bmatrix}X\\Y\end{bmatrix} \mapsto M\begin{bmatrix}X\\Y\end{bmatrix} + \mathbf b,$$ where $M$ is an invertible $2\times2$ matrix and $\mathbf b$ is a fixed vector. The Jacobian matrix of $\phi$ $$J_\phi = \begin{bmatrix}{\partial u\over\partial X} & {\partial u\over\partial Y} \\ {\partial v\over\partial X} & {\partial v\over\partial Y}\end{bmatrix} = M,$$ hence the problem of finding these gradients is reduced to that of computing the matrix of the linear part of $\phi$. This can be conveniently done in homogeneous coordinates: Instead of $M(X,Y)^T+\mathbf b$ we write $\tilde M(X,Y,1)^T$, with $$\tilde M = \begin{bmatrix} M & \mathbf b \\ \mathbf 0^T & 1 \end{bmatrix} = \begin{bmatrix}u_i & u_j & u_k \\ v_i & v_j & v_k \\ 1&1&1\end{bmatrix} \begin{bmatrix}X_i & X_j & X_k \\ Y_i & Y_j & Y_k \\ 1&1&1\end{bmatrix}^{-1} \tag1$$ as the homogeneous matrix of $\phi$. Now, for any invertible matrix $B$, $B^{-1} = {1\over\det B}\operatorname{cof}B$ and the determinant of the right-hand matrix in (1) is equal to twice the area of $T$, so we have $$\begin{bmatrix}X_i & X_j & X_k \\ Y_i & Y_j & Y_k \\ 1&1&1\end{bmatrix}^{-1} = {1\over2A_T}\begin{bmatrix}Y_j-Y_k & X_k-X_j & \cdots \\ Y_k-Y_i & X_i-X_k & \cdots \\ Y_i-Y_j & X_j-X_i & \cdots\end{bmatrix}$$ and finally $$\begin{bmatrix}\nabla u && \nabla v\end{bmatrix} = M^T = {1\over2A_T} \begin{bmatrix} Y_j-Y_k & Y_k-Y_i & Y_i-Y_j \\ X_k-X_j & X_i-X_k & X_j-X_k\end{bmatrix} \begin{bmatrix} u_i & v_i \\ u_j & v_j \\ u_k & v_k \end{bmatrix}.$$
