A program created using C++ to predict collision of cars and calculate their time of collision.
DESCRIPTION : This program is coded to work with in 3d space to predict collision of two cars. The x,y,z coordinates are used to detect whether the cars are collided or not by calculating distance between them. Also the time of collision is calculated by using relative velocities and relative coordinates. The accelerate and brake methods can be used to alter the velocities of the cars. The move method can be used to change coordinate using velocities in respective direction.
HOW TO USE : First create the two cars by providing their make, model, year, initial coordinates, initial velocities. Then use detect_collision function to detect whether collision happens or not. Then use time_to_collision function to predict the time after which collision will happen. You can play with coordinates and velocities using the accelerate, brake and move functions.