⣀⣤⣾⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀ ⠐⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⡟⣿⣿⣶⣄⡀ ⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣸⣿⣇⣿⣿⣿⣿⣿⣆ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣻⣿⡄ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⡿⠍⠙⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⣱⣾⠟ ⢠⠉⠉⠉⠻⣿⣿⡇ ⣽⣿⣿⣿⣿⣿⡿⠛⣡⣶⣿⣧⣤⠸⡟⠂ ⢹⣿⡇ ⢀⣾⣿⣿⣿⣿⠇ ⢈⣥⣿⣿⣿⣿⣿⣷⣆⢰⣆ ⢸⡏ ⣸⣿⣿⣏⣿⡏ ⣾⣾⣿⣿⣿⣿⣿⣿⣿⣿⢻⣿⣷⣾⡃ ⠹⣿⣿⣿⣿⣷⡄⠘⠹⢿⣿⣍⠉⢛⣿⣿⣿⠸⣿⣿⠿⠁ .``````````````````. ⢹⢿⣿⣿⣿⣿⣦⣀⣿⣿⣿⣶⣾⣿⣿⣿⡇⠁⠈⡄ : That's not much. : ⡟⢺⣿⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ ⡺⠁ .`..................` ⢸ ⢸⣿⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣏⣻⡶⠁ .' ⢀⡿ ⣿⡏⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣬⣿⠇ -' ⣤⣶⣶⣿⣿⡛⠻⠿⣿⡿⠛⠁⢰⣿⣿⠃⢘⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏ ⣿⣿⣅⠄⢉⣙⣿⣿⡟ ⠘⣿⡇ ⣿⣦⣿⣿⣿⣿⣿⣿⣿⣟⣻⠇ ⣿⣿⣿⣿⣿⣿⣿⠇ ⣸ ⡇⢠⣿⣧ ⢠⣿⡿⢿⠿⠋⠙⠛⠛⠛⠛⠋⢀ ⣿⣿⠏⣸⣿⣿⣿⣧ ⣷⠸⣿⠃⣴⣿⡟⠙⠁ ⣾⣄⣀⡀⠉⠢⣀ ⣿⣿⣶⣬⣿⣿⣿⣿⣦⡄⣀⡿ ⣿⣿⣇⠹⣷⣤⣾⠇ ⣰⣿⣿⣿⣿⣆ ⠈⠳⡀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢰⣿⣿⡿⢶⣿⣿⡟⢀⣤ ⣰⣿⣿⣿⣿⡿⣭⣷⣄⡀⠘⢄ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⣼⣿⣿⣧⣾⣿⢿⡷⠟⠉ ⠹⠟⠛⢉⠁⡀⠈⠉⠉⠑⢦⡈⠳⡀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⠙⢿⣿⣿⣿⣿⠉ ⢀⡉⡦⠄ ⣿ ⠠⠄ ⠑⠠⠉⠒⢄⡀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⢘⣿⣿⢋⠍⢿⣶⣽⣿⡿⢿⡄ ⣸⡯⡄ ⠙ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣾⣿⣿⣿⣿⣶⣿⣿⣿⣿⣿⣷⣶⣾⣿⣤⣷⣶⣄⣰⣤⣀⣀⣀⣀⣀⣀⣀⣀
#lang racket (require 2htdp/image) (require lang/posn) ;; Convert degrees to radians (define (radians degree) (* degree (/ pi 180))) ;; https://www.mathsisfun.com/polar-cartesian-coordinates.html (define (coord length degree) (list (* length (cos (radians degree))) (* length (sin (radians degree))))) ;; algorithmically generate (define (rays [count 4] [length 100]) (let* ([width (/ 360 (* 2 count))] [initial (- 0 (/ width 2))]) (for/fold ([posns '()]) ([i (range count)]) (append posns (list (list 0 0) (coord length (- (* (* 2 i) width) (/ width 2))) (coord length (+ (* (* 2 i) width) (/ width 2)))))))) ;; https://www.crwflags.com/fotw/flags/jp%5E.html (define (japan-naval #:width [width 300] #:turn [turn 0] #:fg [fg (make-color 188 0 45)] #:bg [bg "white"]) (let* ([height (/ width 3/2)] [radius (/ height 4)] [offset (- radius (/ radius 3))] [uncropped (overlay/offset (overlay (circle radius "solid" fg) (rotate turn (polygon (map (lambda (xy) (apply make-posn xy)) (rays 16 width)) "solid" fg))) ;; move rectangle $offset pixels to the right offset 0 (rectangle width height "solid" bg))] [x (- (/ (image-width uncropped) 2) (/ width 2) (- offset))] [y (- (/ (image-height uncropped) 2) (/ height 2))] [cropped (crop x y width height uncropped)]) cropped))
(require racket/format) (for ([i (range 8)]) (save-image (japan-naval #:turn (* 45/16 i)) (string-join (list "j" (~a i #:align 'right #:width 2 #:pad-string "0") ".png") "")))
Message too long. Click here to view full text.
Message too long. Click here to view full text.