0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

時計の長針と短針のなす角

Posted at

はじめに

中学入試ではよく時計の長針と短針のなす角について出題があります。
場合分けもいろいろあるので、1分刻みで全部調べてみました。

1分間に進む角度

  • 長針は1分間に6度進みます。
  • 短針は1分間に0.5度進みます。

ということは長針が短針を追いかけるとすると、1分間で5.5度の差が縮まります。
追いつくと、また360度の差で再スタートです。

答えの角度は0度以上180度以下の角で答えることに注意します。

コード

clock.jl
for h=0:23 
    for m=0:59
        if abs(30*h-5.5*m)%360<=180
            print(h,"時",m, "分は",abs(30*h-5.5*m)%360,"度","\n")
            else 
            print(h,"時",m, "分は",360-abs(30*h-5.5*m)%360,"度","\n")
        end
    end
end

0時0分は0.0度
0時1分は5.5度
0時2分は11.0度
0時3分は16.5度
0時4分は22.0度
0時5分は27.5度
0時6分は33.0度
.
.
.
23時54分は33.0度
23時55分は27.5度
23時56分は22.0度
23時57分は16.5度
23時58分は11.0度
23時59分は5.5度

これでいつでも角度は求まります!

<計算サイトもありました>
https://www.calc-site.com/stories/clock_time

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?