There was a sport in air craft on independence day


There was a sport in air craft on Independence day. On the air two aircrafts are flying parallely to the ground. Suddenly controller room got an information that both crafts may be colliding. You have to write a java program to check whether they both collide in some point some where or not.

In the controller room there is a Map on paper that will help you to find the solution.
Motion of two crafts are straight line and horizontal to ground. Motion of both crafts can be represented as A1X+B1Y+C1=0 and A2X+B2Y+C2=0 on the Map.

Write a java program to check whether they will collide or not. If they are going to collide print a message that 'The crafts will collide at (x,y)' where co-ordinates (x,y) are on the Map as points of collision. If they are not going to collide print a message 'Both are safe'.

Note :- Coefficients are not negatives

Hints

To check for parallel you can refer formula
A1/A2 = B1/B2 = C1/C2

To find point of collision, you can refer formula
[ (B1*C2-B2*C1)/(A1*B2-A2*B1),(C1*A2-C2*A1)/(A1*B2-A2*B1) ] 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: There was a sport in air craft on independence day
Reference No:- TGS086914

Expected delivery within 24 Hours