Triangle from Coordinates Calculator

Enter three vertices to describe the triangle they make.

The x-coordinate of the first vertex.

The y-coordinate of the first vertex.

The x-coordinate of the second vertex.

The y-coordinate of the second vertex.

The x-coordinate of the third vertex.

The y-coordinate of the third vertex.

Try

Result

You enteredA(0,0), B(4,0), C(0,3)A\left(0, 0\right),\ B\left(4, 0\right),\ C\left(0, 3\right)

A=6, P=12\displaystyle A = 6,\ P = 12

Area

6\displaystyle 6

Perimeter

12\displaystyle 12

Side lengths

AB=4, BC=5, CA=3\displaystyle AB = 4,\ BC = 5,\ CA = 3

Angles

A=90∘, B=36.869898∘, C=53.130102∘\displaystyle A = 90^\circ,\ B = 36.869898^\circ,\ C = 53.130102^\circ

Type

scalene, right\displaystyle \text{scalene, right}

Centroid

(1.333333,1)\displaystyle \left(1.333333, 1\right)
Show the work
  1. Distance formula for the sides

    Call the vertices A=(0,0)A = \left(0, 0\right), B=(4,0)B = \left(4, 0\right) and C=(0,3)C = \left(0, 3\right). Each side is the distance between two vertices, the hypotenuse of a right triangle whose legs are the horizontal and vertical differences.

    Using d=(x2−x1)2+(y2−y1)2d = \sqrt{\left(x_2 - x_1\right)^2 + \left(y_2 - y_1\right)^2}

    AB=(4−0)2+(0−0)2=16+0=16=4BC=(0−4)2+(3−0)2=16+9=25=5CA=(0−0)2+(0−3)2=0+9=9=3\begin{gathered} AB = \sqrt{\left(4 - 0\right)^2 + \left(0 - 0\right)^2} = \sqrt{16 + 0} = \sqrt{16} = 4 \\ BC = \sqrt{\left(0 - 4\right)^2 + \left(3 - 0\right)^2} = \sqrt{16 + 9} = \sqrt{25} = 5 \\ CA = \sqrt{\left(0 - 0\right)^2 + \left(0 - 3\right)^2} = \sqrt{0 + 9} = \sqrt{9} = 3 \end{gathered}
  2. Shoelace formula

    The shoelace formula gives the area of a triangle straight from its vertices, with no height needed. The absolute value makes the area positive whichever way round the vertices are listed.

    A=12∣x1(y2−y3)+x2(y3−y1)+x3(y1−y2)∣=12∣0×(0−3)+4×(3−0)+0×(0−0)∣=12∣0+12+0∣=12×12=6\begin{aligned} A &= \frac{1}{2}\left|x_1\left(y_2 - y_3\right) + x_2\left(y_3 - y_1\right) + x_3\left(y_1 - y_2\right)\right| \\ &= \frac{1}{2}\left|0 \times \left(0 - 3\right) + 4 \times \left(3 - 0\right) + 0 \times \left(0 - 0\right)\right| \\ &= \frac{1}{2}\left|0 + 12 + 0\right| \\ &= \frac{1}{2} \times 12 \\ &= 6 \end{aligned}
  3. Perimeter of the triangle

    The perimeter is the sum of the three side lengths found above, in square units for the area and plain units for the perimeter.

    P=AB+BC+CA=4+5+3=12\begin{aligned} P &= AB + BC + CA \\ &= 4 + 5 + 3 \\ &= 12 \end{aligned}
  4. Law of cosines for the angles

    With a=BCa = BC opposite AA, b=CAb = CA opposite BB and c=ABc = AB opposite CC, the law of cosines turns three sides into an angle. The inverse cosine then gives the angle in degrees.

    Using cos⁡A=b2+c2−a22bc\cos A = \frac{b^2 + c^2 - a^2}{2bc}

    A=cos⁡−1(9+16−252×3×4)=cos⁡−1(0)=90∘B=cos⁡−1(16+25−92×4×5)=cos⁡−1(0.8)=36.869898∘C=cos⁡−1(25+9−162×5×3)=cos⁡−1(0.6)=53.130102∘\begin{gathered} A = \cos^{-1}\left(\frac{9 + 16 - 25}{2 \times 3 \times 4}\right) = \cos^{-1}\left(0\right) = 90^\circ \\ B = \cos^{-1}\left(\frac{16 + 25 - 9}{2 \times 4 \times 5}\right) = \cos^{-1}\left(0.8\right) = 36.869898^\circ \\ C = \cos^{-1}\left(\frac{25 + 9 - 16}{2 \times 5 \times 3}\right) = \cos^{-1}\left(0.6\right) = 53.130102^\circ \end{gathered}
  5. Classifying the triangle

    Compare the squared side lengths. Equal squares mean equal sides, so this triangle is scalene. The two smaller squares added against the largest decide the angles: equal means a right angle, less means an obtuse angle and more means all angles are acute. This one is right.

    9+16=259 + 16 = 25
  6. Centroid of the triangle

    The centroid, where the medians meet, is the average of the three vertices.

    G=(x1+x2+x33,y1+y2+y33)=(0+4+03,0+0+33)=(1.333333,1)\begin{aligned} G &= \left(\frac{x_1 + x_2 + x_3}{3}, \frac{y_1 + y_2 + y_3}{3}\right) \\ &= \left(\frac{0 + 4 + 0}{3}, \frac{0 + 0 + 3}{3}\right) \\ &= \left(1.333333, 1\right) \end{aligned}
  7. Result

    So the triangle has area 66 square units and perimeter 1212 units. It is scalene, right.

Worked examples