Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Atomic Heart
#2
Inspiring, I love color!
Code: (Select All)
_Title "Atomic Heart Beat" 'b+ 2023-02-26 inspired by Danilin's Title and coloring
Const xmax = 400, ymax = 400
Screen _NewImage(xmax, ymax, 32)
CX = xmax / 2: CY = ymax / 2 - 25
While _KeyDown(27) = 0
    r1 = Rnd * 255: g1 = Rnd * 255: b1 = Rnd * 255
    r2 = Rnd * 255: g2 = Rnd * 255: b2 = Rnd * 255
    For magnify = 0 To 10 Step .0005
        For a = -_Pi To _Pi Step _Pi(10 / 360)
            x = CX + magnify * xCard(a)
            y = CY - magnify * yCard(a)
            If a <> -_Pi Then
                Line (x, y)-(lastx, lasty), midInk~&(r1, g1, b1, r2, g2, b2, magnify / 10)
            End If
            lastx = x: lasty = y
        Next
    Next
    _Display
    _Limit 4
Wend

Function midInk~& (r1%, g1%, b1%, r2%, g2%, b2%, fr##)
    midInk~& = _RGB32(r1% + (r2% - r1%) * fr##, g1% + (g2% - g1%) * fr##, b1% + (b2% - b1%) * fr##)
End Function

'Reference and thanks to:
' http://mathworld.wolfram.com/HeartCurve.html
' find the 6th heart curve equations #7, 8
Function xCard (t)
    xCard = 16 * Sin(t) ^ 3
End Function

Function yCard (t)
    yCard = 13 * Cos(t) - 5 * Cos(2 * t) - 2 * Cos(3 * t) - Cos(4 * t)
End Function
b = b + ...
Reply


Messages In This Thread
Atomic Heart - by DANILIN - 02-26-2023, 07:13 PM
RE: Atomic Heart - by bplus - 02-26-2023, 08:03 PM
RE: Atomic Heart - by vince - 03-03-2023, 01:59 PM



Users browsing this thread: 1 Guest(s)