我有两点:
(283,240,302)
(150,150, 50)
我想知道两点的方程,我想找(x,y,z) 距离点(150,150,50)的距离R
答案 0 :(得分:0)
最简单的方法是使用向量:计算AB
向量,并使用比例来计算AC
向量。然后从AC
计算C位置:
A = (150, 150, 50)
B = (283, 240, 302)
from math import sqrt
AB = [A[i] - B[i] for i in range(3)]
length_AB = sqrt(sum([u*u for u in AB]))
AC = [u*600/length_AB for u in AB]
C = [AC[i]+A[i] for i in range(3)]