Should add tolerance of 10*eps to make this function practical. Otherwise you can have a triangle with a 89.9999999 deg angle and it will say it is not a right triangle. Matlab is a numerical language.