0

For a school assignment we are writing/building a routeplanner. We have been given some GDF data to use. We have come very far in developing the application. There is just one issue I can not seem to solve.

We currently have a map which we allow the user to click on. When the user has clicked on our map we can we can find the nearest start and end of a road (coordinate that marks the start and a coordinate that marks the end of a line). The start and end are not the closest coordinates though.

I am looking for a formula or code (whatever you think might help me), that is able to determine the coordinate that is right-angled to the line.

example

I hope the image can clarify a few things (in my situation the angles are never the same). Lets say the line between A and C is even longer and goes on to a position D (D - A - C). I can calculate the distance between B and C, and D and A, but I don't know any of the other lenghts.

Is there something out there that can help me?

4

0 に答える 0