Linear interpolation of three 3D points in 3D space

后端 未结 4 1986
一整个雨季
一整个雨季 2021-01-07 04:00

I have three 3D points like p1(x1,y1,z1), p2(x2,y2,z2), p3(x3,y3,z3). I have another point, but I know only x, y

4条回答
  •  我在风中等你
    2021-01-07 04:28

    You can express P4 coordinates in the P1P2P3 vector basis.

    x4 = x1 + A * (x2 - x1) + B * (x3 - x1)
    y4 = y1 + A * (y2 - y1) + B * (y3 - y1)
    

    This is easy-to-solve linear equation system. You have to find A and B coefficients, then use them to calculate z-coordinate

    z4 = z1 + A * (z2 - z1) + B * (z3 - z1)
    

提交回复
热议问题