在编程语言(Python,C#等)中,我需要确定如何计算直线和水平轴之间的角度?
我认为图像描述的最符合我的要求:

给定(P1 x,P1 y)和(P2 x,P2 y)计算此角度的最佳方法是什么?原点在于topleft,只使用正象限.
我想从这样的点数组中绘制一条弧:
var points = [
[
51.93326250000001,
21.4375
],
[
36.72733749999999,
40.603550000000002
],
[
21.527537500000008,
21.4144
]
];
Run Code Online (Sandbox Code Playgroud)
我尝试使用d3.line(),d3.curveBasis()和d3.curveBundle.beta(1)。
var arcPath = d3.line()
.x(function (d) {
return d[0];
})
.y(function (d) {
return d[1];
})
.curve(d3.curveBasis);
var arc = node.append('path').attr("d", arcPath(points));
Run Code Online (Sandbox Code Playgroud)
但它正在画一条曲线:
这不是我要找的。我想要一个弧线:
我不明白如何使用这个:
var arc = d3.arc()
.innerRadius(180)
.outerRadius(240)
.startAngle(0);
Run Code Online (Sandbox Code Playgroud)
与我的观点。