>>106286105
I'm having a little more fun with this. This isn't quite right, because the official naval flag doesn't do perfect 11.25 degree intervals. Instead, they opted to tweak some of the angles so that the rays on the corner line up cleaner, but I have no idea what angle adjustments they made.
(define (japan-naval [width 300]
#:fg [fg (make-color 188 0 45)]
#:bg [bg "white"])
(let* ([height (/ width 3/2)]
[offset (/ height 4)]
;;[radius (/ width (* 2 (/ 10 3)))]
[radius (/ width 6)]
[uncropped (overlay/offset
(overlay
(circle radius "solid" fg)
(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) (* offset 2))]
[y (- (/ (image-height uncropped) 2) (/ height 2))]
[cropped (crop x y width height uncropped)])
cropped))
I tried some alternate colors out, too.
(define j (japan-naval 900 #:fg (make-color 252 158 79) #:bg (make-color 2 1 34)))
Reference:
https://www.crwflags.com/fotw/flags/jp%5E.html
https://ja.wikipedia.org/wiki/%E6%97%AD%E6%97%A5%E6%97%97#/media/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB:Naval_Ensign_of_Japan.svg