We have some cars and we select some cars from them. Then there are some exit doors. How can I find out that the selected cars are nearest to the exit door? We know each car distance to exit door.
For example, we have 25 cars and we select 5 cars from them. We have 2 exit doors. How can I find out that these 5 cars are nearest to exit door? If not, which car needs to be replaced.
public class ExitDoor { public double ExitDoorAx; //we work with point and it have x and y public double ExitDoorAy; } public class Car { public double CarLocationAx; public double CarLocationAy; }