A= | 1 2 |
| |
|
| |
notazione solo per questo caso, come memo per una somma di determinanti
A= | 1 2 |
( | | | x1 | x2 | | | + | | | x2 | x3 | | | + | | | x3 | ... | | | + | | | xn | x1 | | | ) |
y1 | y2 | y2 | y3 | y3 | ... | yn | y1 |
1 2 |
n | ||||
A = | ∑ | i | (xi+1 - xi)*(yi + yi+1) n+1 ≡ 1 | ||
1 |
eseguendo la moltiplicazione ed eliminando gli addendi opposti
+x1y2 +x2y3 + ... +xny1 -y1x2 -y2x3 - ... -ynx1 |
trapezi: n moltiplicaz + 3n somme circa
shoelace: 2n moltiplicaz + 2n somme circa
The shoelace formula is subject to worse round-off error;
es consideriamo il quadrato di vertici
(1,0), (0,1), (-1,0), (0,-1) di lato √2 e area 2;
trasliamolo in x e y di 108 ottenendo il quadrato di vertici
(108+1,108), (108,108+1), (108-1,108), (108,108-1)
Se vuoi, vedi il foglio di calcolo .ods
ref: wp/"Surveyor's formula" misnamed?
credits: http://www.alexkritchevsky.com/2018/08/06/oriented-area.html
ogni determinante della sommatoria
All that amounts to decomposing a shape into a list of triangles with the origin as the third vertex, and adding their areas. This is totally natural if the origin is fully contained within the polygon.
But signed areas mean that this construction works even if the origin is outside the polygon, with the triangles overlapping, because their overlapping parts cancel perfectly:
The dark areas cancel out of the total sum, because the (negative) area of p1p2O exactly cancels the excess positive areas in each of the other triangles p2p3O,p3p4O,p4p0O, and p0p1O.The coordinate-invariance of this formula (that it works regardless of where
A= | 1 2 |
| | x1 | x2 | x3 | ... | xn | x1 | | | |
y1 | y2 | y3 | ... | yn | y1 |
+x1y2 +x2y3 + ... +xny1
-y1x2 -y2x3 - ... -ynx1
But what does that mean? The notation is meant to be suggestive of a determinant. It’s not literally a determinant because the matrix isn’t square. But you evaluate it in a way analogous to 2 by 2 determinants: add the terms going down and to the right, and subtract the terms going up and to the right
e' solo un simbolo mnemonico per questo caso, suggestivo del determinante 2x2, poiche' nella formula si sommano tutte le diagonali discendenti col + e col - quelle ascendenti.
A= | 1 2 |
| | x1 | x2 | x3 | ... | xn | x1 | | | = |
+x1y2 +x2y3 + ... +xny1 -y1x2 -y2x3 - ... -ynx1 |
y1 | y2 | y3 | ... | yn | y1 |