Compute average distance from point to line segment and line segment to line segment
        Posted  
        
            by Fred
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Fred
        
        
        
        Published on 2010-04-20T01:58:18Z
        Indexed on 
            2010/04/20
            2:03 UTC
        
        
        Read the original article
        Hit count: 564
        
geometry
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.
© Stack Overflow or respective owner