Efficient way to check whether triangles are similar

65 Views Asked by At

If we need to find if a triangle is isosceles, we can compare like a=b, b=c and a=c. But there are 3 comparisons. With $(a-b)(b-c)(a-c) = 0$, we can check it with one comparison.

Usually for similar triangles we do $a/x=b/y=c/z$ method. Can anybody show me a way with one comparison to do it (checking whether two triangles are similar)?

2

There are 2 best solutions below

0
On BEST ANSWER

The triangles with the sides $a,b,c$ and $x,y,z$, where $0<a\le b\le c$ and $0<x\le y\le z$, are similar iff

$$\frac{a}{x}=\frac{b}{y}=\frac{c}{z}\iff\left(\frac{a}{x}-\frac{b}{y}\right)^2+\left(\frac{b}{y}-\frac{c}{z}\right)^2+\left(\frac{c}{z}-\frac{a}{x}\right)^2=0$$

3
On

The triangles with the sides $a,b,c$ and $x,y,z$ with $a\le b\le c$ and $x\le y\le z$ are similar if and only if

$$\pmatrix{a\\b\\c}\times \pmatrix{x\\y\\z}=0$$