function [ u, A ] = fe_coeffs( x1, x2, x3 )
    % The matrix
    %     / x_1  x_2  x_3 \   / x1(1) x2(1) x3(1) \
    % M = | y_1  y_2  y_3 | = | x1(2) x2(2) x3(2) |
    %     \  1    1    1  /   \  1     1     1    /
    M = [[x1 x2 x3]; [1 1 1]];

    detM = abs( det( M ) );
    
    u = [ (x3(2) - x2(2))^2               + (x3(1) - x2(1))^2
         -(x3(2) - x1(2))*(x3(2) - x2(2)) - (x3(1) - x1(1))*(x3(1) - x2(1))
          (x2(2) - x1(2))*(x3(2) - x2(2)) + (x2(1) - x1(1))*(x3(1) - x2(1))]/(2*detM);
     
     A = detM/2;
end

