如何在 JavaScript 中找到圆上的交点?

How to find intersecting point on a circle in JavaScript?

我正在寻找圆上的交点。任何人都可以解决这个问题吗?请找到我的问题的解释图片 click here to see image

我假设您知道圆的半径以及圆心。如果你这样做,那么各个点的坐标如下:

// assume r is set to the radius of the circle
// and (x, y) is the center of the circle
p1.x = x - r * Math.sin(Math.acos(150 / r));
p1.y = y + 150;
p2.x = x + r * Math.sin(Math.acos(150 / r));
p2.y = y + 150;