longestSideLengthStatic static method

double longestSideLengthStatic(
  1. Coordinate a,
  2. Coordinate b,
  3. Coordinate c
)

Computes the length of the longest side of a triangle

@param a a vertex of the triangle @param b a vertex of the triangle @param c a vertex of the triangle @return the length of the longest side of the triangle

Implementation

static double longestSideLengthStatic(
    Coordinate a, Coordinate b, Coordinate c) {
  double lenAB = a.distance(b);
  double lenBC = b.distance(c);
  double lenCA = c.distance(a);
  double maxLen = lenAB;
  if (lenBC > maxLen) maxLen = lenBC;
  if (lenCA > maxLen) maxLen = lenCA;
  return maxLen;
}