股市笑话幽默图片:看一下代码的意思

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/03 03:23:33
angle:=2*Pi*Sec/60
destinationX:=105+30*SIN(angle)
destinationY:=138-30*COS(angle)
Line(1,105,138,destinationX,destinationY)
--angle 和destinationx,destinationy为自定义变量
--320,230为钟表的中心坐标

特别是SIN COS 那一点,请一句一句地翻译一下.谢了......

通过分析,秒针的中心在(105,138);秒针长30.秒针不合钟表中心重合,单独旋转
angle:=2*Pi*Sec/60
计算秒针旋转角度
destinationX:=105+30*SIN(angle)
秒针终点X坐标,105为秒针中心X坐标,秒针长30,30*SIN(angle)就是秒针终点相对于秒针中心的横坐标
destinationY:=138-30*COS(angle)
秒针终点Y坐标,计算机屏幕位于坐标系的第四象限上,所以要减。
Line(1,105,138,destinationX,destinationY)
从(105,138)到(destinationX,destinationY) 画出秒针

SIN COS 是设置角度

画出转动中的秒针的位置