Author Topic: My Best Analog Chiming Clock  (Read 8700 times)

0 Members and 1 Guest are viewing this topic.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: My Best Analog Chiming Clock
« Reply #30 on: November 20, 2020, 10:47:01 am »
Really cool StXaXtic! especially like the fading circular loop.

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: My Best Analog Chiming Clock
« Reply #31 on: November 20, 2020, 06:15:39 pm »
@_vince maybe we could work something up from this?
Code: QB64: [Select]
  1. _TITLE "Beating Cardiod" 'B+ 2019-02-16
  2. '2019-02-28 random magnify and beat, redder heart
  3.  
  4.  
  5. CONST xmax = 800
  6. CONST ymax = 600
  7. SCREEN _NEWIMAGE(xmax, ymax, 32)
  8. _SCREENMOVE (1280 - xmax) / 2 + 30, (760 - ymax) / 2
  9.  
  10. 'center of screen
  11. CX = xmax / 2
  12. CY = ymax / 2 - 50
  13.  
  14. WHILE _KEYDOWN(27) = 0
  15.     CLS
  16.     loopCount = (loopCount + 1) MOD 2
  17.     IF loopCount THEN magnify = 10 ELSE magnify = RND * 10 + 12
  18.     FOR a = -_PI TO _PI STEP _PI(1 / 360)
  19.         x = CX + magnify * xCard(a)
  20.         y = CY - magnify * yCard(a)
  21.         IF a <> -_PI THEN
  22.             LINE (x, y)-(lastx, lasty), _RGB(140, 0, 0)
  23.         END IF
  24.         lastx = x: lasty = y
  25.     NEXT
  26.     PAINT (CX, CY), _RGB(180, 0, 0), _RGB(140, 0, 0)
  27.     _DISPLAY
  28.     IF loopCount THEN _DELAY 40 / 60 ELSE _DELAY (30 + RND * 15) / 65
  29.  
  30. 'Reference and thanks to:
  31. ' http://mathworld.wolfram.com/HeartCurve.html
  32. ' find the 6th heart curve equations #7, 8
  33. FUNCTION xCard (t)
  34.     xCard = 16 * SIN(t) ^ 3
  35.  
  36. FUNCTION yCard (t)
  37.     yCard = 13 * COS(t) - 5 * COS(2 * t) - 2 * COS(3 * t) - COS(4 * t)
  38.  

I'm not so sure it would work, bplus, I'd prefer to remain as just friends

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: My Best Analog Chiming Clock
« Reply #32 on: November 20, 2020, 07:19:54 pm »
LOL!

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: My Best Analog Chiming Clock
« Reply #33 on: November 21, 2020, 12:49:30 pm »
I could never fix your heart, but I can improve your cardioid:

Code: QB64: [Select]
  1. _TITLE "Beating Cardiod" 'B+ 2019-02-16
  2. '2019-02-28 random magnify and beat, redder heart
  3. '2020-11-21 better heartbeat
  4.  
  5. CONST xmax = 800
  6. CONST ymax = 600
  7. SCREEN _NEWIMAGE(xmax, ymax, 32)
  8. _SCREENMOVE (1280 - xmax) / 2 + 30, (760 - ymax) / 2
  9.  
  10. 'center of screen
  11. CX = xmax / 2
  12. CY = ymax / 2 - 50
  13.  
  14. WHILE _KEYDOWN(27) = 0
  15.     CLS
  16.     magnify = 10 + COS(TIMER * 2 * 3.14159)
  17.  
  18.     FOR a = -_PI TO _PI STEP _PI(1 / 360)
  19.         x = CX + magnify * xCard(a)
  20.         y = CY - magnify * yCard(a)
  21.         IF a <> -_PI THEN
  22.             LINE (x, y)-(lastx, lasty), _RGB(140, 0, 0)
  23.         END IF
  24.         lastx = x: lasty = y
  25.     NEXT
  26.     PAINT (CX, CY), _RGB(180, 0, 0), _RGB(140, 0, 0)
  27.     _DISPLAY
  28.  
  29.  
  30. 'Reference and thanks to:
  31. ' http://mathworld.wolfram.com/HeartCurve.html
  32. ' find the 6th heart curve equations #7, 8
  33. FUNCTION xCard (t)
  34.     xCard = 16 * SIN(t) ^ 3
  35.  
  36. FUNCTION yCard (t)
  37.     yCard = 13 * COS(t) - 5 * COS(2 * t) - 2 * COS(3 * t) - COS(4 * t)
  38.  
You're not done when it works, you're done when it's right.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: My Best Analog Chiming Clock
« Reply #34 on: November 21, 2020, 07:03:12 pm »
https://blog.cardiogr.am/what-do-normal-and-abnormal-heart-rhythms-look-like-on-apple-watch-7b33b4a8ecfa

Quote
Normal Heart Rhythm is Irregular
Sometimes 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.
« Last Edit: November 21, 2020, 07:45:22 pm by bplus »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: My Best Analog Chiming Clock
« Reply #35 on: November 21, 2020, 08:19:06 pm »
Consider the bar raised, but you're holding the apple. Model something a little better using the same code ^
You're not done when it works, you're done when it's right.