I am faced with a scenario where two objects are moving at different angles, and I need to determine when they will meet. The goal is to calculate the meeting time of these objects, with the return type being a time value or "infinite" if they will never meet.
Currently, my approach involves using a simulation function to tackle this issue. The function simulates the future movements of the objects for a specified time period and checks their current positions. If the objects intersect at any point in time, the function returns the elapsed time until meeting. If no meeting occurs within the given time frame (e.g. 18 seconds), then it returns "infinite".
I am curious if there exists a physics formula or computer science algorithm that could help me solve this problem more efficiently. Is there a straightforward algorithm available to calculate the meeting time of two moving objects with distinct angles?