Compute average distance from point to line segment and line segment to line segment
- by Fred
Hi everyone,
I'm searching for an algorithm to calculate the average distance between a point and a line segment in 3D. So given two points A(x1, y1, z1) and B(x2, y2, z2) that represent line segment AB, and a third point C(x3, y3, z3), what is the average distance between each point on AB to point C?
I'm also interested in the average distance between two line segments. So given segment AB and CD, what is the average distance from each point on AB to the closest point on CD?
I haven't had any luck with the web searches I've tried, so any suggestions would be appreciated.
Thanks.