distanceSqToPoint method

num distanceSqToPoint(
  1. Vector3 point
)

Implementation

num distanceSqToPoint(Vector3 point) {
  final directionDistance = _vector.sub2(point, origin).dot(direction);
  if (directionDistance < 0) {
    return origin.distanceToSquared(point);
  }
  _vector.setFrom(direction).scale(directionDistance).add(origin);
  return _vector.distanceToSquared(point);
}