length method

num length()

Implementation

num length() {
  var head = this.head();
  var tail = this.tail();

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

  return -1;
}