Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pengxiaohua/clock-by-canvas
用canvas绘制一个时钟,同时可以适应不同的宽度和高度改变,钟面的元素跟着比例改变
https://github.com/pengxiaohua/clock-by-canvas
Last synced: about 2 months ago
JSON representation
用canvas绘制一个时钟,同时可以适应不同的宽度和高度改变,钟面的元素跟着比例改变
- Host: GitHub
- URL: https://github.com/pengxiaohua/clock-by-canvas
- Owner: pengxiaohua
- License: mit
- Created: 2017-05-12T07:56:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-12T08:18:13.000Z (over 7 years ago)
- Last Synced: 2023-09-05T10:02:06.311Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clock-by-canvas
用canvas绘制一个时钟,同时可以适应不同的宽度和高度改变,钟面的元素跟着比例改变>一个圆的弧度就是圆的周长,即`2*Math.PI*r`,每小时之间的弧度是`2*Math.PI*r/12`
>求钟面12个小时数字位置时,可利用数学中`sin`和`cos`求出点与原点连线,还有与水平线垂直线组成的直角三角形,每小时之间弧度是`2*Math.PI*r/12`,求出夹角sin或cos值,求出12个小时分别所在的想对坐标点