rather then getting the longest edge, get the edge which which is most different from the 2 others ends up giving more useful results: for an isosceles triangle it returns the base weather its longer or shorter then the other sides.