
function [FP] = interpol(Point,Triangle)
// 
  FP = zeros(3,1);
//
  x = Point(1); y = Point(2);  
//
  X = Triangle(:,1);   Y = Triangle(:,2);
  D = X(1)*(Y(3)-Y(2)) +X(2)*(Y(1)-Y(3)) + X(3)*(Y(2)-Y(1));
//
  a = (Y(3)-Y(2))/D; b = (X(2)-X(3))/D; c = (X(3)*Y(2) - X(2)*Y(3))/D;
  FP(1) = a*x + b*y + c;

  a = (Y(1)-Y(3))/D; b = (X(3)-X(1))/D; c = (X(1)*Y(3) - X(3)*Y(1))/D;
  FP(2) = a*x + b*y + c;

  a = (Y(2)-Y(1))/D; b = (X(1)-X(2))/D; c = (X(2)*Y(1) - X(1)*Y(2))/D;
  FP(3) = a*x + b*y + c;

endfunction


