Understanding this concept is better with visual aids. I have a set of green points located here:
https://i.sstatic.net/V8VEC.png
My goal is to determine several points along the red line shown below:
https://i.sstatic.net/b26AK.png
Although this illustration provides a top view, I possess comprehensive XYZ coordinates for each point as well as information on which vertices are connected.
Initially, it may seem plausible to simply find the midpoint of each green edge and connect them in a straight line, but due to certain nuances, this method might not be entirely accurate towards the end of the line.
Is there an algorithm that can be applied to identify the best-fit line through these 3D points?
I am exclusively utilizing Three.js for this task, if that holds any significance.