isKite property

bool get isKite

Whether this is a kite

Two pairs of consecutive sides are equal in length.

Implementation

bool get isKite {
  final ab = AB.length, bc = BC.length, cd = CD.length, da = DA.length;
  // Pair 1: AB==BC and CD==DA, or Pair 2: AB==DA and BC==CD
  return ((ab - bc).abs() < _epsilon && (cd - da).abs() < _epsilon) ||
      ((ab - da).abs() < _epsilon && (bc - cd).abs() < _epsilon);
}