Skip to content

Commit 8a42c57

Browse files
committed
原稿 : 時計の短針の計算ミスを修正
1 parent 04e71f3 commit 8a42c57

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/clock.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ var s = now.getSeconds(); // 秒(0〜59)
125125
sShape.rotation = s * (360 / 60);
126126
// 分針
127127
mShape.rotation = m * (360 / 60);
128-
// 短針 (短針は時間だけでなく分も角度に考慮する)
129-
hShape.rotation = h * (360 / (24 / 2)) + m * (360 / 24 / 60);
128+
// 短針 (短針は時間だけでなく分も角度に考慮する) ※次のコードの「12」は短針の目盛りの数
129+
hShape.rotation = h * (360 / 12) + m * (360 / 12 / 60);
130130
```
131131

132132

samples/clock_smh.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
sShape.rotation = s * (360 / 60);
6969
// 分針
7070
mShape.rotation = m * (360 / 60);
71-
// 短針 (短針は時間だけでなく分も角度に考慮する)
72-
hShape.rotation = h * (360 / (24 / 2)) + m * (360 / 24 / 60);
71+
// 短針 (短針は時間だけでなく分も角度に考慮する) ※次のコードの「12」は短針の目盛りの数
72+
hShape.rotation = h * (360 / 12) + m * (360 / 12 / 60);
7373

7474
// Stageの描画を更新
7575
stage.update();

0 commit comments

Comments
 (0)