0
\$\begingroup\$

I've made a simple drawing:

enter image description here

The distance between these two points is calculated with a simple formula:

enter image description here

Which gives: 5,38

I need to calculate the green point's coordinates, which is set at 80% distance from the B point towards the A point.

I could make a direction vector between A and B, and then, add (dir * 5.38 * 0.8) to the B point itself, but it gives me strange results.

Is there a simpler (and more efficient!) way to achieve that?

\$\endgroup\$