What this calculator does
This tool finds the area and perimeter of a triangle when you know the Cartesian coordinates of its three corners: A(\(x_1\), \(y_1\)), B(\(x_2\), \(y_2\)), and C(\(x_3\), \(y_3\)). The inputs are plain real numbers on the coordinate plane, so they can be negative, zero, integer, or decimal. The results carry the same units as your coordinates: area in square units, perimeter in linear units. If your coordinates are pure numbers, the answers are dimensionless.
How to use it
Enter the x and y value for each of the three points A, B, and C, then read the area and the perimeter. The table also breaks the perimeter into its three sides AB, BC, and CA so you can check individual edge lengths.
The formulas explained
The area comes from the shoelace formula. The signed quantity \((x_1 \cdot y_2 + x_2 \cdot y_3 + x_3 \cdot y_1 - y_1 \cdot x_2 - y_2 \cdot x_3 - y_3 \cdot x_1)\) equals twice the signed area; dividing by 2 and taking the absolute value gives a positive area no matter whether the vertices are listed clockwise or counter-clockwise. The perimeter is simply the sum of the three side lengths, each found with the Pythagorean distance formula between two points.
$$A = \frac{1}{2}\left| x_1(y_2 - y_3) + x_2(y_3 - y_1) + x_3(y_1 - y_2) \right|$$ $$\text{where}\quad \left\{ \begin{aligned} x_1, y_1 &= \text{A}_x,\ \text{A}_y \\ x_2, y_2 &= \text{B}_x,\ \text{B}_y \\ x_3, y_3 &= \text{C}_x,\ \text{C}_y \end{aligned} \right.$$ $$P = \overline{AB} + \overline{BC} + \overline{CA}$$ $$\text{where}\quad \left\{ \begin{aligned} \overline{AB} &= \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} \\ \overline{BC} &= \sqrt{(x_2 - x_3)^2 + (y_2 - y_3)^2} \\ \overline{CA} &= \sqrt{(x_3 - x_1)^2 + (y_3 - y_1)^2} \end{aligned} \right.$$
Worked example
For A(-2, 3), B(-3, -1), C(3, -2): the cross-product term is \(2 + 6 + 9 + 9 + 3 - 4 = 25\), so \(S = \left|\frac{25}{2}\right| =\) 12.5. The sides are \(AB = \sqrt{17} \approx 4.1231\), \(BC = \sqrt{37} \approx 6.0828\), \(CA = \sqrt{50} \approx 7.0711\), giving a perimeter \(L \approx\) 17.27694.
More Worked Examples
Example 1: A right triangle with A(0, 0), B(4, 0), C(0, 3)
Shoelace terms, with \((x_1,y_1)=(0,0)\), \((x_2,y_2)=(4,0)\), \((x_3,y_3)=(0,3)\):
- \(x_1(y_2-y_3) = 0\,(0-3) = 0\)
- \(x_2(y_3-y_1) = 4\,(3-0) = 12\)
- \(x_3(y_1-y_2) = 0\,(0-0) = 0\)
Sum \(= 0+12+0 = 12\), so $$A = \tfrac{1}{2}\,|12| = 6$$ The area is 6 square units. The sum is positive, so the vertices run counter-clockwise.
Side lengths:
- \(AB = \sqrt{(4-0)^2+(0-0)^2} = \sqrt{16} = 4\)
- \(BC = \sqrt{(0-4)^2+(3-0)^2} = \sqrt{16+9} = \sqrt{25} = 5\)
- \(CA = \sqrt{(0-0)^2+(0-3)^2} = \sqrt{9} = 3\)
Perimeter \(= 4+5+3 = \) 12 units. Check: this is a 3-4-5 right triangle, and the legs give \(\tfrac{1}{2}\cdot 4\cdot 3 = 6\), which matches.
Example 2: Collinear points A(0, 0), B(1, 1), C(3, 3)
- \(x_1(y_2-y_3) = 0\,(1-3) = 0\)
- \(x_2(y_3-y_1) = 1\,(3-0) = 3\)
- \(x_3(y_1-y_2) = 3\,(0-1) = -3\)
Sum \(= 0+3-3 = 0\), so \(A = \tfrac{1}{2}\,|0| = 0\). The points lie on one line (here \(y=x\)), so there is no true triangle.
Distances:
- \(AB = \sqrt{1^2+1^2} = \sqrt{2} \approx 1.4142\)
- \(BC = \sqrt{2^2+2^2} = \sqrt{8} = 2\sqrt{2} \approx 2.8284\)
- \(CA = \sqrt{(-3)^2+(-3)^2} = \sqrt{18} = 3\sqrt{2} \approx 4.2426\)
Perimeter \(= \sqrt{2}+2\sqrt{2}+3\sqrt{2} = 6\sqrt{2} \approx 8.4853\). Because B lies between A and C, \(AB+BC = AC\), so the perimeter equals \(2\cdot AC = 6\sqrt{2}\): the path goes out to C and back.
How to Calculate by Hand
- List the vertices in order: \(A(x_1,y_1)\), \(B(x_2,y_2)\), \(C(x_3,y_3)\).
- Compute the three cross terms: \(x_1(y_2-y_3)\), \(x_2(y_3-y_1)\), \(x_3(y_1-y_2)\).
- Add them to get the shoelace sum \(S\).
- Take the absolute value and halve it: \(A = \tfrac{1}{2}|S|\).
- For each side, compute the differences, e.g. \(dx = x_2-x_1\) and \(dy = y_2-y_1\) for AB. Do the same for BC (B to C) and CA (C to A).
- Square, add and take the square root for each side: \(AB=\sqrt{dx^2+dy^2}\), and likewise for BC and CA.
- Add the three sides: \(P = AB+BC+CA\).
Rounding tips
- Keep the squared distances (\(dx^2+dy^2\)) exact and only take square roots at the end.
- Do not round intermediate side lengths before summing. Round the final perimeter to the precision you need, usually 2 to 4 decimal places.
- The area from the shoelace formula is exact for exact inputs. With integer coordinates it is always a multiple of 0.5.
Quick sanity checks
- Triangle inequality: the sum of the two shorter sides must be greater than the longest side. If it is equal, the points are collinear.
- The area should be consistent with the sides. A triangle with perimeter \(P\) cannot have a larger area than an equilateral triangle of the same perimeter, \(P^2/(12\sqrt{3})\).
- Swapping any two vertices should change only the sign of \(S\), not the area.
FAQ
What if the area is zero? A zero area means the three points are collinear (they lie on one straight line), so they do not form a real triangle.
Does the order of the points matter? No. The absolute value in the shoelace formula makes the area independent of whether you list the vertices clockwise or counter-clockwise.
Can I use negative coordinates? Yes. Any real numbers are valid, including negatives and decimals.