Trigonometric Triangle Trouble

Yesterday’s post at /r/dailyprogrammer managed to pique my interest1:

A triangle on a flat plane is described by its angles and side lengths, and you don’t need all of the angles and side lengths to work out everything about the triangle. (This is the same as last time.) However, this time, the triangle will not necessarily have a right angle. This is where more trigonometry comes in. Break out your trig again, people.


Triangle Trilemma

Four points, a square?) and comes originally from a Google Code Jam problem. The problem is stated simply enough

Accept three points as input, determine if they form a triangle, and, if they do, classify it at equilateral (all three sides the same), isoceles (two sides the same, the other different), or scalene (all three sides different), and also classify it as acute (all three angles less than 90 degrees), obtuse (one angle greater than 90 degrees) or right (one angle equal 90 degrees).

But once you start implementing it, that’s when things get more interesting. 😄