This is a snippet of code to use in your projects when you need to determine the intersection of two lines, defined by line segments. It's based on the formula found here: https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given%20two%20points%20on%20each%20line