💾 Archived View for midnight.pub › posts › 1058 captured on 2024-08-18 at 19:55:05. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-05-24)
-=-=-=-=-=-=-
The trains have been incredibly bad these past few weeks, a fact that makes me mourn even more the current loss of my bike, especially since the WiFi consistently isn't working meaning that there is very little for me to do except stare at my watch and sigh.
To decrease my alarmingly upsetting levels of boredom and my apathy for bureaucracy and people in general, I began to play with my watch on my phone and ponder:
At what Time(s) are the Minute hand and Hour hand exactly 180°?
For example, at 6pm/6am, the hour hand is exactly facing down and the minute hand exactly facing up. What other instances of this are there?
I came up with two approaches, one brute force and the other more elegant.
(with-current-buffer (switch-to-buffer "*Messages*") (require 'cl) (let* ((required-angle-diff 180) (angle-precision 1) (minute-precision 0.01) ;; calc-once (angle-between-hours (/ 360 12)) (all-mins (reverse (cdr (reverse (number-sequence 0 60 minute-precision))))) (all-hours (number-sequence 1 12))) (cl-labels ((angle-for-min (mins) (* 360 (/ mins 60))) (angle-for-hour (hour mins) (let* ((start-hour-angle (* 360 (/ (float (mod hour 12)) 12))) (min-angle-suppl (* angle-between-hours (/ (float mins) 60)))) (+ start-hour-angle min-angle-suppl))) (angle-in-range (diff-angle) (and (> diff-angle (- required-angle-diff angle-precision)) (< diff-angle (+ required-angle-diff angle-precision)))) (diff-angle-hourmin (hour mins) (let* ((angle-min (angle-for-min mins)) (angle-hour (angle-for-hour hour mins)) (diff-angle (abs (- angle-hour angle-min)))) (if (angle-in-range diff-angle) (cons (abs (- diff-angle required-angle-diff)) diff-angle))))) ;; Brute force it (dolist (curr-hour all-hours) (setq hour-hit-min (cons 100 0)) (dolist (curr-min all-mins) (let ((angle-hit (diff-angle-hourmin curr-hour curr-min))) (if angle-hit (if (< (car angle-hit) (car hour-hit-min)) (setq hour-hit-min (list (car angle-hit) curr-min (cdr angle-hit))))))) (message "%02d:%02d:%02d - %.2f°" curr-hour (floor (cadr hour-hit-min)) (* 60 (- (cadr hour-hit-min) (floor (cadr hour-hit-min)))) (caddr hour-hit-min))))))
01:38:10 - 179.99° 02:43:38 - 180.02° 03:49:05 - 180.00° 04:54:33 - 180.03° 05:59:59 - 179.94° 06:00:00 - 180.00° 07:05:27 - 180.02° 08:10:54 - 180.00° 09:16:21 - 180.02° 10:21:49 - 179.99° 11:27:16 - 180.01° 12:32:43 - 180.02°
Interestingly, Hour 5 and Hour 6 share the same position -- meaning there are only 11 states and 22 times a day when the Hour hand and Minute hand are at parity with each other.
In 1 hour:
In total then, the Minute hand needs to move an extra:
The above is a Geometric Series of the form:
The infinite Sum of such a series (convergent if r < 1):
So the Minute hand needs to travel 65mins and 27.3 seconds in order to achieve a constant angle between the Hour hand.
To calculate where the Minute hand will be for a given Hour, we just note that the "zero" state of the Minute hand starts at 6, and with this we can generate a general formula of:
Minute Hand Angle (h) = ((h - 6) mod 12) * 360 / 11 Minute Hand Minutes (h) = ((h - 6) mod 12) * 60 / 11 where h is a given hour
None. I got home a few minutes ago. I will watch TV and fall asleep.
Here's a nice interactive clock to play with
Glad to see I'm not the only person that goes on complex and disturbing (to everyone watching me) tangents when bored, hope you're doin' good!
something about this seems somehow practical, for some reason, but also I hope you had a relaxing time back at the pad! thx 4 sharin
I've done the math behind this after staring at a clock and having the same question while in high school. Unlike your code, however, I'd never considered 5:59:59 as a possibility. In a subtle way, I think it's a demonstration that 0.999... == 1.