This paper presents the development of a real-time algorithm for collision detection, collision avoidance and guidance to way-point. Three-dimensional point-mass aircraft models are used. For collision detection, time of closest point of approach(CPA) and distance at CPA are compared to threshold values. For collision avoidance, optimal acceleration input which maximizes the terminal relative distance is calculated based on optimal control theory. For guidance to way-point, proportional navigation guidance, the well-known method, is used. Two scenarios of encounter situation are illustrated to validate performance of proposed algorithm.