Area of lattice point polygon

I’m wanting to calculate the area of a shape students create on a virtual geoboard given a set number of “rubber bands”-- segments. I’ve been noodling around with trying to figure out how to implement Pic’s formula or the Shoelace formula.
In terms of the Shoelace formula I am stuck on order the points as clockwise. I have the location as a function of the angle from the origin to the point (polar), but can’t figure out how to sort the list. Haven’t gotten further than that.
Ideas?
Resources I have found so far:



https://en.wikipedia.org/wiki/Shoelace_formula#:~:text=The%20shoelace%20formula%20or%20shoelace,Cartesian%20coordinates%20in%20the%20plane.&text=It%20has%20applications%20in%20surveying%20and%20forestry%2C%20among%20other%20areas.

A few new features with lists were released last week, including a sort that might help you out.
https://www.desmos.com/calculator/ajjg0oouxl

1 Like

This might be what you’re looking for: Polygon Shoelace Area Formula

I took an old shoelace graph I had that didn’t worry about point order, and added some sorting based on angle to the centroid. Watching the polygon update feels weird, but it should always prevent cross-over.

1 Like

That’s cool! I love how it switches around to keep it a polygon!

I need to pull it into the geoboard graph now. The way the graph is built right now is that the kids have “bands” they can use to construct the polygon-- I’m thinking that is just going to be too complicated and it is better to do it the way you have it where they can modify a polygon to fit the situation.

So I am running into a problem. The location of the shape affects the area calculation.
https://www.desmos.com/calculator/f3bg9vbzub

I got it working using an alternative formulation for the Shoelace Formula. Geoboard 10x10 Pentagon with Area Calculation