如下代码,得到了12个刻度的定位值,但是我不知道怎么加入起始角度,求指点
function calc() {
const times = 12;
const posList = [];
const radius = 200;
// 角度
const avd = 360 / times;
// 弧度
const ahd = (avd * Math.PI) / 180;
for (let i = 0; i < times; i++) {
posList.push({
left: Math.sin(ahd * i) * radius,
top: Math.cos(ahd * i) * radius,
});
}
return posList;
}