Finding coordinates of a point between two points?

后端 未结 4 463
半阙折子戏
半阙折子戏 2020-12-03 18:09

Doing some 3D stuff in wpf- want to use a simpler test to see if everything is working (before moving to curves).

The basic question is given two points x1,y1,z1 and

4条回答
  •  攒了一身酷
    2020-12-03 19:05

    a line joining the points in 3d is given by equation:

    (x - x1)/(x2 - x1) = (y - y1)/(y2 - y1) = (z - z1)/(z2 - z1)

    You have the values of x1,y1,z1,x2,y2,z2. This will give you an equation for the line.

    another equation would be

    ((x-x1)^2+(y-y1)^2+(z-z1)^2)^(1/2)=distance

    Solve the 2 equations to get the value of the points.

提交回复
热议问题