Given the time in 24 hour format (2359
= 11:59pm
) return the angle between the minute and hour hands on a standard clock (on the face plane, so don't just output 0).
Angles are to be returned in the unit of your choice, should be the smallest possible, and should be a positive number (negative angle converted to a positive value), i.e. you will never have an answer greater than 180 degrees or pi radians.
Some examples to check against (in degrees)
0000
=0.0
0010
=55.0
0020
=110.0
0030
=165.0
0040
=140.0
0050
=85.0
0150
=115.0
0240
=160.0
0725
=72.5
1020
=170.0
1350
=115.0
1725
=12.5
Note: There are a few that have rounding errors, I'm not sure how that should be handled; if we should force consistency across all values.
0001
,0633
, etc... I notice that many answers actually produce incorrect results. \$\endgroup\$