So I learned about this formula in coordinate geometry where if you know the coordinates of the three vertices in a triangle, you can calculate the area.
My question is how do you derive this formula. I would appreciate a step-by-step full derivation so I can actually understand why this formula works.
Best Answer
This is actually a specific case of something known as Gauss' shoelace formula or Gauss' area formula, which can be generalized beyond a triangle to any number of vertices (under the right circumstances). This is typically presented in a different way than your formula, but they're essentially the same.
Let me show how they're the same first: let us have the points $(x_1,y_1), (x_2, y_2), (x_3, y_3)$ defining a triangle. For Gauss' formula, we line these up in a table (see below), with the first point at the bottom and the top, with the points listed going counterclockwise from the first point.
From the top-left entry, we connect to the entry one down and one to the right with a blue line, until we get to the final entry of the left column, which connects to nothing. Then, from the top-right entry, we do the same, connecting to the one which one down and one left with a red line. This gives us
Then we multiply every connected entry together. If connected by a blue line, then we add it to the other terms; if by a red line, we subtract it. At the end, we take the absolute value of $1/2$ this sum. This gives us in our triangle case
$$A = \left| \frac{x_1y_2 + x_2y_3 + x_3y_1 - x_1y_3 - x_2y_1 - x_3y_2 }{2} \right|$$
Now we just do some factoring out of the $x$ terms, obtaining:
$$A = \left| \frac{x_1(y_2 - y_3) + x_2(y_3 - y_1) + x_3(y_1 - y_2)}{2} \right|$$
As you can see, this is basically the same formula as in your question. It's way easier to remember as "draw the table, do the connections, add/subtract as needed, take the absolute value of half the value" though, in my opinion. Especially for polygons with more sides.
Mathologer on YouTube did a video of this, with a visual proof of its validity among other discussions about it. He could explain it probably way better than I could so I'll just leave you with the video.