小编Ale*_*lex的帖子

我们如何写出模拟时钟的角度表达式?

这是我参考的书中作为解决方案给出的表达,但似乎超出了我的理解。请任何人帮助理解我们究竟是如何写这个角度的?为什么要减去pi/2?我真的不知道

xs=(int)(Math.cos(s*3.14f/30-3.14f/2)*45+xcentre);
ys=(int)(Math.sin(s*3.14f/30-3.14f/2)*45+ycentre);
xm=(int)(Math.cos(m*3.14f/30-3.14f/2)*40+xcentre);
ym=(int)(Math.sin(m*3.14f/30-3.14f/2)*40+ycentre);
xh=(int)(Math.cos((h*30+m/2)*3.14f/180-3.14f/2)*30+xcentre);
yh=(int)(Math.sin((h*30+m/2)*3.14f/180-3.14f/2)*30+ycentre);
Run Code Online (Sandbox Code Playgroud)

java math trigonometry

4
推荐指数
1
解决办法
107
查看次数

标签 统计

java ×1

math ×1

trigonometry ×1