>>106308052
Complete example you can paste into DrRacket:
#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))))))))
(define (japan-naval #:width [width 300]
#:fg [fg (make-color 188 0 45)]
#:bg [bg "white"])
(let* ([height (/ width 3/2)]
[radius (/ width 6)]
[offset (- radius (/ radius 3))]
[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) (/ width 2) (- offset))]
[y (- (/ (image-height uncropped) 2) (/ height 2))]
[cropped (crop x y width height uncropped)])
cropped))
https://racket-lang.org/