10088

[highlight]Theory[/highlight]

Picks formulae :::

ans=area of polygon-B/2+1;

Given a polygon whose vertices are of integer coordinates (lattice points), count the number of lattice points within that polygon.
Pick’s theoreom states that
i = A - {B \over 2} + 1

where;

  • A  is the area of the polygon.
  • B  is the number of lattice points on the exterior

Area of a polygon:

First, number the vertices in order, going either clockwise or counter-clockwise, starting at any vertex.

The area is then given by the formula

[highlight]Solution:[/highlight]

 

Leave a Reply

Your email address will not be published. Required fields are marked *