0
\$\begingroup\$

This question already has an answer here:

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\$

marked as duplicate by Bálint, Community Jan 24 '18 at 16:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.