Given a point $C=(2, 6)$ and a line segment $A=(4, -2)$, $B=(6, 4)$ I need to calculate the furthest point (on the line segment) between $AB$ and $C$, with the maximum distance $D$ provided.
Graph: https://i.sstatic.net/eVZTz.jpg
Some examples:
- Given a distance $D=5.831$, an expected result would be $(5, 1)$ on the line segment.
- Given a distance $D=6.964$, an expected result would be $(4.5, -0.5)$ on the line segment.
Best Answer
Thanks to Vasya, I realised that it just requires a circle around point C and then a function to find where the line intersects. Here's the code (C#):