In this video we're going to talk about how to calculate the area of a triangle if we're given the three vertices of the triangle. So to calculate the area we could use this formula. It's 1 half the absolute value of the determinant of a 3x3 matrix.
In this case let's call that matrix A. Now matrix A is going to be defined this way. It's in the first column we're going to have x1, x2, x3.
In the second column, y1, y2, y3. In the third column, we're going to have three ones. So this is x1, x2, and x3.
And this is y1, y2, and y3. So let's replace the x and y values. So in the first column, the x values will be 1, 4, and 4. The y values will be 1, 1, and 5. And in the last column, just 3 ones. Now, in order to evaluate the determinant of that 3x3 matrix, what we're going to do is we're going to write the first column, 1, 4, 4. And then the second column, 115. And then the third column. And then we're going to write the first column again.
And then the second column. Now, starting from the top left, we're going to multiply these three numbers. So 1 times 1 times 1 is 1. And then 1 times 1 times 4, that's going to be 4. So plus 4. And then 1 times 4 times 5 is 20. Next we're going to start from the bottom left and we're going to multiply these numbers.
4 times 1 times 1 is 4. 5 times 1 times 1 is 5. And 1 times 4 times 1 is 4. 1 plus 4 plus 20 is 25. And then we have minus. 4 plus 4 is 8 plus 5 that's 13. So this is 12. So the determinant of this 3 by 3 matrix is 12. Now the area is 1 half of the determinant. So 1 half of 12 is 6. Therefore our answer is 6 square units.
And we can confirm this answer if we graph this particular triangle. So let's put some points on it, and let's go to 5 in both directions. So the first point is at 1,1, which will be right here. The next one is at 4,1, and then 4,5. So we have a nice right triangle.
Notice that the length of the base is 3 units and the height, which is the difference between 5 and 1, is 4 units. The area of a right triangle is 1 half base times height. So the base is 3, the height is 4. 3 times 4 is 12. 1 half of 12 is 6. So in both cases you'll get the right answer. Now for the sake of practice, let's try a slightly harder example.
So let's determine, let's calculate the determinant of matrix A. So in the first column, we're going to have the x values, 2, 5, and 10. So that's x1, x2, and x3, 2, 5, and 10. Now the y values will be 3, 7, and negative 5. And then the last column is just going to be 1, 1, and 1. So now let's expand it. Let's write the first column, 2, 5, 10, and then the second column, 3, 7, negative 5, and then the third column, and then the first column, and then the second column. So starting from the top left, we're going to multiply these three numbers. 7 and 1. So 2 times 7 times 1 is 14. And then we're going to multiply these three numbers.
3 times 1 times 10 is 30. And then these three, 1 times 5 times negative 5 is negative 25. And then minus. Now we're going to start from the bottom left and multiply the three numbers going in the upward diagonal direction. 10 times 7 times 1 is 70. And then we have negative 5 times 1 times 2. That's negative 10. And then 1 times 5 times 3 is 15. Now, 30 minus 25 is 5. 5 plus 14 is 19. 70 minus 10 is 60. 60 plus 15 is 75. Now 19 minus 75. That is going to be negative 56. Now the area is going to be one half of the determinant of the matrix. But The area has to be positive.
So we're going to use the absolute value of negative 56 Half 56 is 28. So the answer is 28 square units So that's how you could calculate the area of a triangle using Matrices and determinants, but now let's confirm this answer by graphing This particular triangle, so we'll keep in mind that the area is 28. So we only need to go up to 10 on the x-axis and on the y-axis we only need to go up to positive 7 but we do need to go down to negative 5. So the first point is at 2 comma 3 which is here. The next one is at 5. 7, which should be around here, and then 10 negative 5. So we don't have a typical right triangle. What we have is a scaling triangle. So this is 2, that's 3, and let's see, this is at 5. So how can we get the area without using matrices or determinants?
What we need to do is determine the length of each side and then we could use Huron's formula to get the area of the triangle. So starting from this point and going to this point we need to travel three units to the right and so going from two to five that's three units and then we need to travel going from 3 to 7, that's 4 units, so 4 units up. Notice that this part forms the 3, 4, 5 right triangle. If you want to find the hypotenuse of this right triangle, you could use the Pythagorean theorem.
So the square root of 3 squared plus 4 squared, so 3 squared is 9, 4 squared is 16, 9 plus 16 is 25, the square root of 25 is 5. But if you know... your right triangles like the 3 4 5 right triangle the 5 12 13 to 8 15 17 you know if that if the two sides are 3 & 4 the hypotenuse has to be 5 now let's go from this point to this point so this point is at 5 7 and this point is at 10 negative 5 So to go from here to here, we have to travel 5 units to go from 5 to an x-value of 10. Then we need to go down from 7 to negative 5. So negative 5 minus 7, that's 12. So we're going down 12 units. And notice we have the 5, 12, 13 triangle.
Using the Pythagorean theorem, it's going to be square root of 5 squared plus negative 12 squared. 5 squared is 25. 12 squared is 144. 25 plus 144 is 169. And when you square root it, you get 13. So this side is 13 units. Now let's go from this point to this point.
So we need to go down from 3 to negative 5. Negative 5 minus 3 is 8, so we're going down 8 units. And then going from an x value of 2 to an x value of 10, we're traveling 8 units to the right. So this is a 45-45-90 degree triangle, which means the hypotenuse will be one of the side lengths times root 2. So it's going to be 8 root 2. But you could use the Pythagorean theorem to get that answer.
We have the square root of 8 squared plus negative 8 squared. 8 squared is 64 plus another 64. So that's 128. 128 is 2 times 64. Which we can write as the square root of 64 times the square root of 2 the square root of 64 is 8 so we get 8 root 2 So if we were to redraw this triangle This side is 5 this is 13 and this side is 8 root 2 Let's call this A, B, and C. So if you know the three sides of a triangle, you can use Huron's formula. First, you need to calculate S, which is half of the perimeter of the triangle.
So it's 1 half plus 5 plus 13 plus 8 square root 2. 5 plus 13 is 18. So multiplying both numbers by a half, we get that s is going to be half of 18 is 9, half of 8 is 4. So the exact value for s is 9 plus 4 square root 2. But for those of you who prefer a decimal answer, this is approximately 16.65685425. So now that we have s, we can calculate the area. The area is going to be the square root of s times s minus a times s minus b times s minus c.
Now if you have a calculator, if you have this saved as your previous answer, you could just replace s with the answer key of your calculator to make the calculation easy. If not, you could just plug in s as 9 plus 4 root 2. And then it's s minus a, so 9 plus 4 root 2 minus a, a is 5. And then s minus b, so we're going to subtract that by b, which is 13. And then s minus c, c is 8 root 2. let's simplify that here we have 9 minus 5 so we can make that 4 and here we have 9 minus 13 so we can make that negative 4 and 4 root 2 minus 8 root 2 that's going to be negative 4 root 2. You know what's interesting? We may not have to use a calculator to get this answer. We can actually do it by hand. Notice that these two are a difference of perfect squares.
Well, when you multiply them, they will become a difference of perfect squares. It's like multiplying a plus b times a minus b and you're going to get a squared minus b squared. The two middle terms will cancel. So we can avoid using the calculator in solving this one.
So 9 times 9 is 81. Now granted this is the longer way, you know, just so you know. And 4 root 2 times 4 root 2. 4 times 4 is 16. root 2 times root 2, that is the square root of 4, which is 2. So 16 times 2 is 32. And these two, we could do the same thing as well. So 4 times negative 4 is going to be negative 16. And 4 root 2 times 4 root 2, that's going to be 16 times 2, but this is going to be plus 32. 81 minus 32 81 minus 30 is 51 minus 2 that's going to be 49 negative 16 plus 32 or 32 minus 16 is just 16 so we can break this up to the square root of 49 times the square root of 16 square root of 49 is 7 the square root of 16 is 4 7 times 4 gives us 28. So we get the same answer. But as you can see, using matrices, it's a lot easier. So if you want to calculate the area of a triangle, given the vertices, the best way to do that is to find the determinant of the 3x3 matrix, as we talked about in this video, and just divide that by 2. That will give you the area of the triangle.