// Himawari K. Katayama with Sosuu Yakyoku
open System
open System.Drawing
open System.Windows.Forms
let a = 1
let b = 13
let rational x y = Seq.unfold (fun n -> if n = 0 then None
else Some (n / y, (n % y) * 10)) x
let phi = (1. + sqrt(5.)) / 2.
let ang = (2. * Math.PI) / (1. + phi)
let size = 75.
let k x = (0.998 ** x) * 1.
let brushes = [|
Brushes.Black; Brushes.Brown;
Brushes.Red; Brushes.Orange;
Brushes.Yellow; Brushes.Green;
Brushes.Blue; Brushes.Violet;
Brushes.Gray; Brushes.LightGray;
|]
let form = new Form(Text="Himawari", Width=640, Height=640)
form.Paint.Add(fun e ->
rational a b |>
Seq.take 2000 |>
Seq.iteri (fun i ra ->
let sheeta = (float i) * ang
let x = Math.Cos sheeta
let y = Math.Sin sheeta
let r = k (float i)
let rr = size * r
let viewp = 380.0 - rr / 2.0
e.Graphics.FillEllipse(
brushes.[ra],
float32 (x * r * 320.0 + viewp),
float32 (y * r * 320.0 + viewp),
float32 rr,
float32 rr)
)
)
form.Show()