【发布时间】:2022-10-23 22:19:56
【问题描述】:
我正在尝试在 2 点之间的圆上找到中间点,pictorial drawing
有给定的半径、p1、p2 和圆的中点。
p1 和 p2 之间的距离是一个直径,我正在尝试编写 python 公式来返回这两个点之间的圆上的点。我知道这是一个相当愚蠢的问题,但我现在试着做 3 个小时,而我在网上能找到的只是这两点之间的距离。
我正在尝试找到 p3 的公式(如图所示)
这就是我到目前为止所做的:
import math
points = [[100, 200], [250, 350]]
midpoint = (int(((points[0][0] + points[1][0]) / 2)), int(((points[0][1] + points[1][1]) / 2)))
radius = int(math.sqrt(((points[1][0] - points[0][0])**2) + ((points[1][1] - points[0][1])**2))) // 2
# This below is wrong
print(int(midpoint[0] - math.sqrt((points[0][1] - midpoint[1]) ** 2)),
int(midpoint[1] - math.sqrt((points[0][0] - midpoint[1]) ** 2)))
【问题讨论】:
-
你的具体问题是什么?
-
已编辑的问题。我正在寻找位于圆圈上给出的 2 之间的第三点的公式。数学或 Python
-
这似乎更像是一个数学问题而不是 Python 问题。