求圆内坐标形成三角形

Find coordinates inside a circle to form a triangle

我遇到以下给定问题:我在 (2,3) 处的圆(橙色点)外有一个点,根据数学公式,我找到了离橙色点最近的坐标圆圈(也就是蓝点)。

现在如何画一个等边三角形,蓝色点为三角形顶点之一,每边长为0.02个单位?蓝色点的坐标为(3.505025253169417, 1.4949747468305832),圆的半径为0.7

要制作所需的三角形,我需要另外两个顶点坐标吗?如何找到它们。

谁能帮我写下这个问题的伪代码?

等边三角形的高是边长的 sqrt(3)/2 倍。将距离b-a归一化,得到同方向的单位向量。将它添加到 b 将成为基地的中心。交换cxy,并改变一个符号,得到垂直向量。加上和减去这个向量得到三角形的底边。

from matplotlib import pyplot as plt
import numpy as np

a = np.array([2, 3])  # orange point
b = np.array([3.505025253169417, 1.4949747468305832])  # blue point
side = 0.2
height = side * np.sqrt(3) / 2
c = (b - a) / np.linalg.norm(b - a) * height
d = np.array([c[1], - c[0]]) / height * side / 2
e = b + c + d
f = b + c - d

plt.scatter(*b)
plt.scatter(*a)
plt.scatter(*(b + c), alpha=0.4)
plt.scatter(*e)
plt.scatter(*f)
triangle = np.array([b, e, f, b])
plt.plot(triangle[:, 0], triangle[:, 1], color='gold')
plt.fill(triangle[:, 0], triangle[:, 1], color='gold', alpha=0.3)
plt.gca().set_aspect('equal')
plt.show()