# How to determine if a triangle can be drawn with the given points.

Given $3$ points $$(x_1, y_1), (x_2, y_2), (x_3, y_3),$$ how does one determine whether they are vertices of a triangle?

Thanks.

• en.wikipedia.org/wiki/Triangle_inequality – GTX OC Sep 19 '14 at 11:53
• The triangle inequality deals with lengths, points. – Martigan Sep 19 '14 at 11:54
• If the points are given,you can always find the distance between them. – GTX OC Sep 19 '14 at 11:54
• Have you ever tried to draw a triangle, given three points in the plane? – Christian Blatter Sep 19 '14 at 12:08
• @ChristianBlatter its to determine with a program that handles larger numbers, that ain't possible to draw by myself. – x0x Sep 19 '14 at 12:13

1: Find area of triangle formed by 3 points. if not zero they can form triangle.

2: Find line equation of 2 vertices and check if the 3rd vertices is present on this line. if not they can form triangle. Similarly Find the slope of the line joining points A and B,then find the slope of the line joining A and C.If they are same,then you can't draw a triangle.(@rah4927)

• The second way can also be rephrased as follows:Find the slope of the line joining points A and B,then find the slope of the line joining A and C.If they are same,then you can't draw a triangle.Otherwise,you can. – rah4927 Sep 19 '14 at 11:59

The area of a triangle is given by the formula $$|\frac12 det(\vec{AB}, \vec{AC})|$$

Let $$\vec{A}=(x_1,y_1), \vec{B}=(x_2,y_2), \vec{C}=(x_3, y_3)$$

Then $$\vec{AB}=(x_2-x_1, y_2-y_1), \vec{AC}=(x_3-x_1,y_3-y_1)$$

Then it must hold that $$| (x_2-x_1)(y_3-y_1)-(y_2-y_1)(x_3-x_1)| \neq 0$$

A triangle can be drawn with three points iff these three points are three different points.

EDIT: in order to be more precise in the core of my answer, and not in comment: three distincts colinear points form a degenerate triangle, but a triangle nonetheless. It is a geometric figure with three angles (they can be calculated, and not in the case where there are only one or two disctinct points) and their sum is 180°...

• They might be collinear. – user175968 Sep 19 '14 at 11:55
• what if the three different points are on a line? – x0x Sep 19 '14 at 11:55
• For me this is still a triangle (a flat one), since you have three angles you can define and measure. If you have two point identical, or three, you can't define the three angles... – Martigan Sep 19 '14 at 12:07
• I am NOK with the downvotes. A degenerate triangle is a triangle... Or else explain to me why not... – Martigan Sep 19 '14 at 12:16
• @Martigan: someone asking a question as basic as the OP's won't surely understand "degenerate triangles": in high school, a triangle is a plane figure obtained by joining three non-collinear points by straight line segments. And even following your reasoning: the three points do not have to be different, as the degenerate triangle's vertices could aslo be degenerate, or collapsed into two or only one point representing the three vertices. Too much for such a basic question, imo. – Timbuc Sep 19 '14 at 14:02