lengthSquared method

num lengthSquared()

Implementation

num lengthSquared() {
  final head = this.head();
  final tail = this.tail();

  if (tail != null) {
    return tail.point.distanceToSquared(head.point);
  }

  return -1;
}