06-22-2022, 02:59 PM
Here's a fun one from All4Baisc, Charlie's BAM translation:
Code: (Select All)
_Title "Bird Math - BAM translation to QB64" 'b+ 2022-06-22
' ref Charlie's post http://basic4all.epizy.com/index.php?topic=159.0
' The trigonometric functions by Hamid Naderi Yeganeh from his original artwork (Parrot)
' https://www.huffpost.com/entry/mathematical-birds_b_8876904
' Missing parts of functions found at https://www.flerlagetwins.com/2018/04/parrot.html
Dim pi, k, k1, k2, a, b As Double
Screen _NewImage(751, 720, 32): _ScreenMove 250, 20
pi = 3.1415929: k1 = -10000: k2 = 10000: c~& = _RGB32(130, 0, 0)
Window (0, 0)-(6000, -5750)
Color , &HFF8888FF: Cls
For k = k1 To k2
a = Int(((3 * k / 20000) + (Cos(37 * pi * k / 10000)) ^ 6 * Sin((k / 10000) ^ 7 * (3 * pi / 5)) + (9 / 7) * (Cos(37 * pi * k / 10000)) ^ 16 * (Cos(pi * k / 20000)) ^ 12 * Sin(pi * k / 10000)) * 1000)
b = -1 * Int(((-5 / 4) * (Cos(37 * pi * k / 10000)) ^ 6 * Cos((k / 10000) ^ 7 * (3 * pi / 5)) * (1 + 3 * (Cos(pi * k / 20000) * Cos(3 * pi * k / 20000)) ^ 8) + (2 / 3) * (Cos(3 * pi * k / 200000) * Cos(9 * pi * k / 200000) * Cos(9 * pi * k / 100000)) ^ 12) * 1000)
Circle (3000 - a, -1000 - b), 60, c~&
Next k
Sleep
b = b + ...