Skip to the content of the web site.

Project M.1: Tic-tac-toe

Write a program that describes the property of a triangle described by either three pairs of points or three lengths of the sides.

Properties may include:

  1. whether or not it is a triangle;
  2. whether or not it is degenerate (the three points are collinear);
  3. the area;
  4. the length of the perimeter;
  5. the three interior angles;
  6. the centroid;
  7. whether or not is it right-angled, acute or obtuse; and
  8. whether or not is it an isosceles or equilateral triangle.

You should choose an appropriate error which will determine whether or not a triangle is right-angled or not. For example, if one angle is within $10^{-14}$ of $\frac{\pi}{2}$, you may consider it to be right-angled.

Do you want to enter three points or three lengths of the sides (p/s)? p
Enter the first point:  3.32 2.93
Enter the second point: 4.91 7.12
Enter the third point:  5.93 7.35

Your output