Suppose, I have many 3d line segments which suppose to be intersected with another given line segment. So, I wish to take a line segment and the given line to get the intersection point. Again, I wish to get the next line segment and the same given line segment to find their intersection point. So, at the end of this process I will have many points which lie on that given line segment (I guess). Now, I want to get an average coordinate for all those point, but that point also should be located on the same given line segment. Could you please let me know an easy way to implement this process? Thanks in advance.
Computing the average coordinate for more than 2 points on a 3d line segment
0
$\begingroup$
geometry
vector-spaces
computational-geometry
-
0See my answer below – 2012-01-26
1 Answers
2
Points on a 3D line can be expressed by the paramentric equations $x_i=k+at_i, \; y_i=l+bt_i, \; z_i=m+ct_i$
If you take the sum of the co-ordinates of $n$ such points you get $ \sum x_i=nk+a \sum t_i, \; \sum y_i=nl+b \sum t_i, \; \sum z_i=nm+c \sum t_i$
so if you take the average of the co-ordinates you get $ \frac{\sum x_i}{n}=k+a \frac{\sum t_i}{n}, \; \frac{\sum y_i}{n}=l+b \frac{\sum t_i}{n}, \; \frac{\sum z_i}{n}=m+c \frac{\sum t_i}{n}$ which satisfies the original parametric equation and so lies on the line.
-
0thank you very much for your explanation. – 2012-01-27