Where did i go wrong in calculation of lattice points:
Let there be a rectangle ABCD with vertices A($x_1$,$y_1$), B($x_2$,$y_1$), C($x_2$,$y_2$), D($x_1$,$y_2$); where all vertices are lattice points.
Take $x_2 > x_1$, $y_2 > y_1$.
Then for AB line segment, y is constant so number of lattice points will depend on x. Such points will be just $x_1$, $x_1 +1$,......,$x_2$. Thus their number would be ($x_2$-$x_1$+1).
Using same arguments for other edges i got:
Number of boundary lattice points, b = 2($x_2$-$x_1$+1) + 2($y_2$-$y_1$+1) - 4(2).
[Subtracting by 4(2) as we have counted every vertex twice.]
Now when $y=y_1$, number of such points is ($x_2$-$x_1$+1).
We get another set of lattice points if we take $y=y_1 +1$, while their number still depending on $x$ remains same. So from $y=y_1$ to $y=y_2$, we get all possible sets of lattice points. Thus ($x_2$-$x_1$+1) will occur ($y_2$-$y_1$+1) times, which is total lattice points of the rectangle. Then,
Number of these points in the interior = ($x_2$-$x_1$+1)($y_2$-$y_1$+1) - b.
[Subtracting b as we need only interior points.]
After using the pick's formula, i am getting area to be ($x_2$-$x_1$)($y_2$-$y_1$) + 2 which is 2 more than the correct value.