我无法从度数中找到单位圆上的点
I can't find dots on an unit cirlce from degrees
我想要圆圈周围所有地方的坐标
Debug.Log("Degree: " + Degree);
x = Mathf.Cos(Degree);
y = Mathf.Sin(Degree);
Debug.Log("x: " + x + " y: " + y);
我的输出是:
Degree: 60
x: -0.952413 y: -0.3048106
Degree: 120
x: 0.814181 y: 0.5806112
Degree: 180
x: -0.5984601 y: -0.8011526
Degree: 240
x: 0.3257813 y: 0.9454452
Degree: 300
x: -0.02209662 y: -0.9997559
Degree: 360
x: -0.2836911 y: 0.9589157
为什么这不起作用?我知道的简单几何学说这应该给我每 60 度的位置
正如 Pac0 在评论中所说
from the Mathf.Cos Unity3d documentation "f The input angle, in radians."
Degree = (float)((Math.PI / 180) * Degree);
x = Mathf.Cos(Degree);
y = Mathf.Sin(Degree);
编辑:抱歉添加了实际解决我问题的代码
我想要圆圈周围所有地方的坐标
Debug.Log("Degree: " + Degree);
x = Mathf.Cos(Degree);
y = Mathf.Sin(Degree);
Debug.Log("x: " + x + " y: " + y);
我的输出是:
Degree: 60
x: -0.952413 y: -0.3048106
Degree: 120
x: 0.814181 y: 0.5806112
Degree: 180
x: -0.5984601 y: -0.8011526
Degree: 240
x: 0.3257813 y: 0.9454452
Degree: 300
x: -0.02209662 y: -0.9997559
Degree: 360
x: -0.2836911 y: 0.9589157
为什么这不起作用?我知道的简单几何学说这应该给我每 60 度的位置
正如 Pac0 在评论中所说
from the Mathf.Cos Unity3d documentation "f The input angle, in radians."
Degree = (float)((Math.PI / 180) * Degree);
x = Mathf.Cos(Degree);
y = Mathf.Sin(Degree);
编辑:抱歉添加了实际解决我问题的代码