3 % Compute areas of triangles mesh
6 %
'q': `2\times\nq` array, `{\q}(\il,j)` is the `\il`-th coordinate of the `j`-th vertex, `\il\in\{1,2\}` and `j\in\{1,\hdots,n_q\}.`
8 % me: `3\times\nme`
'int32' array,`\me(\jl,k)` index of storage, in the array `\q`, of the `\jl`-th
9 % vertex of the triangle of index `k`, `\jl\in\{1,2,3\}` and `k\in\{1,\hdots,\nme\}.`
13 % areas: `1\times\nme` array, areas(k) is the area of triangle k.
15 d21 = q(:,me(2,:))-c1;
16 d31 = q(:,me(3,:))-c1;
17 area = 0.5*(d21(1,:).*d31(2,:)-d21(2,:).*d31(1,:));