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?

user1118321
  • 25,567
  • 4
  • 55
  • 86
Orion
  • 1,258
  • 2
  • 14
  • 32
  • This seems exactly what I am looking for. I've been searching a lot but it seems my search query wasn't correct. I'll let you know if this solves my problem. – Orion Jun 10 '13 at 07:41
  • My question was correctly marked as duplicate. The answer provided there gave me my answer. This proves the importance of the correct search query (which is harder for non-native english speakers). – Orion May 30 '14 at 08:02

0 Answers0