Bounding Box & Intersection

Games use segment intersection tests all the time, for everything from line of sight to checking whether a bullet hit a monster. This is the most complicated of the four AABB tests, and is commonly known as a slab test. It finds the time of the line’s intersection with the near and far edges of each axis of the AABB. If they overlap, the segment is intersecting. - Intersection Tests in 2D

see also

Written on April 13, 2023, Last update on June 14, 2023
math codingame line intersection