How can I find the first point along a heading that is a specified distance away from a line segment?
问题 Given a starting point, a heading, a distance, and a line segment, find the first point along this heading that is the specified distance away from this line segment. I covered two cases, but I haven't been able to cover the last one. First case: heading away from the line. Ignore it even if the starting point is within the specified distance. Second case: It intersects the line. I solved it using trig and triangles. Initially didn't consider the next case. Third case: It is heading towards