Heart Rate Animation

Hi all,
I wanted the heart sticker to fade in and out with #ZHR# so worked on the following expression for opacity, which starts at 0 on screen wakeup, rises to 100, and back to 0 in 1 heartbeat.

((-cos((#ZHR#/30)*#DWE#*pi)+1)*50)

Changing the function changes the start value.

((cos((#ZHR#/30)*#DWE#*pi)+1)*50)    = 100>0>100 in 1 heartbeat
((sin((#ZHR#/30)*#DWE#*pi)+1)*50)    = 50>100>0>50 in 1 heartbeat
((-sin((#ZHR#/30)*#DWE#*pi)+1)*50)   = 50>0>100>50 in 1 heartbeat

I decided it would be good to change the size of the sticker too, but you wouldn’t want that going to 0, so changed the expression to incorporate radius and variance. This enhanced expression can still be used for full opacity in the above expressions, but can be used for any graphic you want to shrink or grow relative to a value such as heart rate.
The following expressions are equivalent to the ones above, if you set radius and variance both to 100. For size, set r to the width/height you require, and v to the variance.

(((cos((#ZHR#/30)*#DWE#*pi)+1)*-v/2)+r)  = object will grow from (r-v)>(r)>(r-v) in 1 heartbeat
(((-cos((#ZHR#/30)*#DWE#*pi)+1)*-v/2)+r) = object will shrink from (r)>(r-v)>(r) in 1 heartbeat
(((sin((#ZHR#/30)*#DWE#*pi)+1)*v/2)+r)   = object will grow from (r+v/2)>(r+v)>(r)>(r+v/2) in 1 heartbeat
(((-sin((#ZHR#/30)*#DWE#*pi)+1)*v/2)+r)  = object will shrink from (r+v/2)>(r)>(r+v)>(r+v/2) in 1 heartbeat

I hope this can be of use to budding designers, I’m not a graphics person!

7 Likes

Hi

Great work. I have appreciated very much your post. Thanks you for sharing,
Moreover appreciated because me and math we are as different as chalk and cheese. LOL
Thanks, greetings

2 Likes

Great work - thanks for sharing!

1 Like