^^Area di un poligono, shoelace formula.

A=  1

2

|
x1 x2 x3 ... xn x1
y1 y2 y3 ... yn y1
|

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

 

Si ottiene dalla formula dell'area calcolata col metodo dei trapezi

  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 

 

Nome

shoelace formula
the pattern of multiplications resembles lacing a shoe

Quale formula e' migliore ?

Somma piu' economica di moltiplicazione

trapezi:       n moltiplicaz + 3n somme    circa

shoelace:   2n moltiplicaz +  2n somme   circa

Numeri con meno cifre, piu' economici, meno proni ad errori di arrotondamento

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?

Interpretazione geometrica

 

 

        

 

credits: http://www.alexkritchevsky.com/2018/08/06/oriented-area.html

ogni determinante della sommatoria

  1. ha come colonne le coordinate di 2 vertici consecutivi del poligono
  2. il suo valore e' uguale all'area del bivettore fatto dai raggi vettore che vanno dall'origine del riferimento cartesiano o vettoriale, ai 2 vertici

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 O is) should be enough to motivate it as mathematically valuable.

Links

  1. inet

  2. johndcook/polygon-area
  3. wp/Shoelace_formula
  4. oriented area

 

Approfond

Dis .odg|pdf

Notazione

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

Dirlo. Che notazione è? 

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.

Talk

A= 1

2

| x1 x2 x3 ... xn x1 | =
 +x1y2 +x2y3 + ... +xny1  
 -y1x2 -y2x3 - ... -ynx1 
y1 y2 y3 ... yn y1