1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
% Construction de la matrice M
sxx = sum (power(PointsSegment(:,1),2))
sxy = sum (PointsSegment(:,1).*PointsSegment(:,2))
sx = sum (PointsSegment(:,1))
syy = sum (power(PointsSegment(:,2),2))
sy = sum (PointsSegment(:,2))
n = PO
MatriceM = [sxx sxy sx; sxy syy sy; sx sy n]
% Construction de la matrice V
sxz = sum (PointsSegment(:,1).*PointsSegment(:,3))
syz = sum (PointsSegment(:,2).*PointsSegment(:,3))
sz = sum (PointsSegment(:,3))
MatriceV = [sxz; syz; sz]
% Recherche de la matrice X (a b c)
MatriceX = inv(MatriceM) * MatriceV |
Partager