0
我需要帮助。我想要找到this image中绿色点的坐标,因为您知道红色点是第一个位置,它旋转了75,17度。如何从角度找到(x,y)坐标
两条线的长度相同。请帮我解决这个数学问题。我需要为我的脚本代码。
我需要帮助。我想要找到this image中绿色点的坐标,因为您知道红色点是第一个位置,它旋转了75,17度。如何从角度找到(x,y)坐标
两条线的长度相同。请帮我解决这个数学问题。我需要为我的脚本代码。
function blah(oX, oY, angle) {
var radius = Math.sqrt(oX * oX + oY * oY);
var oTheta = Math.atan2(oX, oY);
var nTheta = oTheta - angle * Math.PI/180;
return {x: radius * Math.sin(nTheta), y: radius * Math.cos(nTheta)};
}
var newPoint = blah(0, -83, 75.17); // use positive for counterclockwise angle, negative for clockwise angle
console.log(newPoint.x, newPoint.y);
你好,欢迎来到Stack Overflow。这是数学,而不是编程,因此是一种偏离主题。但这正是三角函数所要做的。检查'Math.sin'和'Math.cos'。 – Amadan
是的,我知道,但我混淆。我只想在输入角度时在x和y轴上创建对象的新坐标。 –