Expression for Heartrate Hand

Hello,

i need a Expression to make a Indicator for the Heartrate.

Can someone help me?

Hi.

Expression for heartrate is #ZHR#.

Greetings,

Phantasico aka GAUSS

Thanks, this i know, but i need the Expression for the Rotation Hand.

I want it to start at 50 Beats and end at 200 Beats.

Well, this is not that easy to anwer. Didnā€˜t build a rotational yet. It depends as well on the angle the hands should describe. There are no docs yet. Have a look at Tomaja watches, i think he made oneā€¦

Hi Tuffij,
Thereā€™s a bunch of other questions on these things you need to answer. your scale is 50-200. what is the dial size? Do your want to sweep from 50 to 200 through a whole circle (360 degrees)? half a circle (180)? three-quarters? (270) two-thirds (240)?
125 is half of your range. 50-125 is on one side and 125-200 is on the other side. Where is the middle 125 point? Is it straight up (12:00 position)? down (6:00)? leftā€¦ rightā€¦

Maybe just sketch an image and post it?

-john

50 should be an the left at 315 degrees
200 on the right at 45 degrees
Radius should be 40

@tuffij,
The good news is when we drag the timeline at least #ZHR# changes value but thereā€™s two bad news (newses?). LOL two points of bad news.

  1. ZHR doesnā€™t move far enough to hit either 50 or 200 values so weā€™ll have to formula our way into the gauge sweep with no testing.
  2. When you drag the timeline, ZHR doesnā€™t move in a linear fashion (like steps). It kind of hops all over the place.

Letā€™s just look at your numbers since we canā€™t do it live. You want the pointer to swing clockwise from 315-degrees (10:30) to 45 degrees (2:30). Thatā€™s a quarter of a circle - a 90 degree swing. Likewise, you want to move 50 to 200 points of ZHR value, thatā€™s 150 point increase clockwise. In short, you want a 150 point increase in 90-degree clockwise swing. 90 divided by 150 is 0.6. So, each increasing value of (1) on ZHR needs to move the needle 0.6 degrees clockwise. Fine.

Ok then, where does the starting value land? Your lowest value 50ā€¦ times 0.6 degrees = 30 degrees. Thatā€™s at 2:00 but we donā€™t want to start at 2:00, we want to start at 10:30 or 315 degrees, which is also -45 degrees. So letā€™s backup that pointer by 75 degrees. 30 degrees (2:00) minus 75 = -45 degrees (10:30).

Then hereā€™s a formulaā€¦ ([value] * 0.6) - 75
Does it work for the starting point? (50 * 0.6) - 75 = -45 degrees. Yes it works. Thatā€™s 10:30.

Ok then how about your top value of 200? hopefully it lands on positive 45 degrees (2:30).
Your max point: (200 * 0.6) - 75 = 45 degrees. Yes, the formula still works. Thatā€™s 2:30.

So then there you go: the [value] is #ZHR#. Use this formula in the rotation field of your pointer in your ZHR gauge:

((#ZHR# * 0.6) - 75)

Hopefully my narrative helps to show you how I think about these things when Iā€™m building them. If the formula works for your min and max, and the value movement is linear, then it must work for all values in-between.

-john
EDITED: watch moved down lower in thread

2 Likes

Great work and very good explanation, John!

Thanks @GAUSS!

Oh, @tuffij - one more thing. You want this gauge to pass through 12:00 where degrees resets back to zero. When Iā€™m working in that direction - through zero - I tend to use the negative side of the high degree values (-45 instead of 315).

However if you wanted the gauge to swing the other way without passing through zero then I would work linearly between 45-degrees and 315-degrees.

-john

thank you all!!!

and how about a ā€œBarindicatorā€? Hight 5 width 100, should start at 50 (Width 0) an end at 200 (width 100)?

Same Idea @tuffijā€¦
For this, I used a Creator SHAPE (line). (a) itā€™s easy to add and (b) when you change width, the line only grows on one side. In other words, the line shape is Left Justified, which is extremely convenient in this case.

So same process. You want the width of the shape to increase to 100 over 150 value change in ZHR. Again, 100 divided by 150 = 2/3rds orā€¦ every time ZHR increases by (1) the shape width has to increase (to the right) by 2/3.

Where does that leave you on your lowest value 50? (50 * 2) / 3 = 33.33333. Fine but we need the width to start at zero. So just substract from the total:

Formula: (((#ZHR#*2)/3)-33.33333)

We know it works for your low value: (((502)/3)-33.33333) is ā€œpretty damn close to zeroā€
The high end 200? (((200
2)/3)-33.33333) = ā€œpretty damn close to 100ā€. It works.
I added the bar to my sandbox face.

Letā€™s pause for a moment on ā€œpretty damn closeā€¦ā€ Whenever you have to add or substract some long-winded decimal, youā€™re never going to land on exact values. Many people bang their heads against the wall trying to get to exact values. They should just load up formulas that are ā€œcloseā€ or ā€œgood enoughā€ and at least see what they look like first.

No one can see the difference between this gaugeā€™s width hitting 100 or 100.000006 on a little, tiny watch screen thatā€™s barely 1-1/2 inches wide. Yet, people still spend hours trying to hit that perfect, lengthy formula. I call this the ā€œSheldonā€ effect LOL. Iā€™m more in the Howard Wolowitz camp (and Iā€™m an Engineer). Yes, you can FLOOR() and CEILING() and whatever() but who cares. If it looks great on the watch already then ā€œpretty damn closeā€ is good enough.

1 Like

Thank you!!!

just practising my dial construction: (the dark version is for viewing here. Use the light and tint to suit, for watchface.)

90Ā° (+/- 45) arc - heavy marks at 30Ā°, lighter at 6Ā°, and thin at 3Ā°.

I would normally load into a 300px+ square, correctly centred ā€¦ but left that to you to try (if needed). There is a small cross at exact centre of arc.