我有一条线,该线具有对应于点A和B的两组坐标(x1,y1)和(x2,y2)。我可以使用下式计算这两个点之间的欧几里得距离(L2范数):
point_a = (189, 45)
point_b = (387, 614)
line= (point_a, point_b)
point_array = np.array(line)
distance = np.linalg.norm(point_array)
print('Euclidean distance = ', distance)```
How is it possible to obtain the co-ordinates for the line scaled about it's midpoint?
i.e. I would like to scale the length of the line but keep the angle.
1条答案
按热度按时间x4shl7ld1#
为此,你必须这样做的中点。