Listen to QB64 Report!Our podcast on all things QB64 is out now. Listen athttp://podcast.qb64.org
0 Members and 1 Guest are viewing this topic.
@_vince maybe we could work something up from this?Code: QB64: [Select]_TITLE "Beating Cardiod" 'B+ 2019-02-16'2019-02-28 random magnify and beat, redder heart CONST xmax = 800CONST ymax = 600SCREEN _NEWIMAGE(xmax, ymax, 32)_SCREENMOVE (1280 - xmax) / 2 + 30, (760 - ymax) / 2 'center of screenCX = xmax / 2CY = ymax / 2 - 50 WHILE _KEYDOWN(27) = 0 CLS loopCount = (loopCount + 1) MOD 2 IF loopCount THEN magnify = 10 ELSE magnify = RND * 10 + 12 FOR a = -_PI TO _PI STEP _PI(1 / 360) x = CX + magnify * xCard(a) y = CY - magnify * yCard(a) IF a <> -_PI THEN LINE (x, y)-(lastx, lasty), _RGB(140, 0, 0) END IF lastx = x: lasty = y NEXT PAINT (CX, CY), _RGB(180, 0, 0), _RGB(140, 0, 0) _DISPLAY IF loopCount THEN _DELAY 40 / 60 ELSE _DELAY (30 + RND * 15) / 65WEND 'Reference and thanks to:' http://mathworld.wolfram.com/HeartCurve.html' find the 6th heart curve equations #7, 8FUNCTION xCard (t) xCard = 16 * SIN(t) ^ 3END FUNCTION FUNCTION yCard (t) yCard = 13 * COS(t) - 5 * COS(2 * t) - 2 * COS(3 * t) - COS(4 * t)END FUNCTION
Normal Heart Rhythm is IrregularSometimes people say “irregular pulse” as a shorthand for an abnormal heart rhythm. That’s not quite right, because a normal pulse is irregular. In fact, it’s regularly irregular: your heart rate varies periodically due to your breathing rate and autonomic nervous system. The frequency and depth of variation reflects nearly everything that happens in your life, including your level of physical activity, emotional state, and whether you’re sleeping or waking.