normalizedDirection property

Point get normalizedDirection

Get the normalized direction vector

Implementation

Point get normalizedDirection {
  final mag = sqrt(direction.x * direction.x + direction.y * direction.y);
  if (mag == 0) return Point(0, 0);
  return Point(direction.x / mag, direction.y / mag);
}