exupero's blog
RSSApps

Lines dividing lines

I have a goal to be outside for a thousand hours in a 365-day period, and one of the metrics I calculate is how long I need to spend outside, on average, each day. At the beginning of the year I needed 1,000 hours ÷ 365 days ≈ 2.7 hours per day. I fell behind through the winter and each day I needed more time than the day before, but this summer I've been working outside and getting about eight hours each day, so the amount of time I need per day has dropped back to around 2.6 hours and is continuing to fall. I became curious about the shape of the drop, so I created this model:

I need 335 more hours for the year, and I'm getting about eight hours per day, so the total time I need is denoted by the numerator, 335 – 8d. I only have 125 days left before reaching a full year from when I started tracking, but that number is shrinking at a rate of one day per day, which provides the denominator of 125 – d.

As for the shape of the function, I'm suspicious it's a hyperbola, due to the d in the denominator, but with a d also in the numerator it's hard to be certain. It's one linear equation divided by another.

To manipulate this into something more recognizable, let's turn the 8d into 8(125 – d) and subtract the added 8×125:

Then we can simplify:

This is much closer to a conventional form for a hyperbola, namely y = A/x. However, the equation above has some scaling and translation. It's been shifted right by 125 units, scaled vertically by a factor of 665, and shifted up 8 units.

More generally, the expression for dividing one linear function by another is:

To do the manipulation shown above, choose an S such that Sd = b:

Since Sd = b, we can substitute S = b/d: