# Thread: Calculate Elevation Gain and Loss

1. ## Calculate Elevation Gain and Loss

I need to calculate my elevation gain and loss. Say I started at 1000 feet above sea level. Then, I go on a hike and go up and down hilly terrain. I might reach some different elevations:

- Start
1000
1030
1100
1150
1090
1220
1500
1350
1200
1092
1000
- End

Is there a calculation or formula that I can use to determine my total gain and loss based on my starting elevation of 1000?

2. Hello, nnhubbard!

I need to calculate my elevation gain and loss.
Say I started at 1000 feet above sea level.
Then I go on a hike and go up and down hilly terrain.
I might reach some different elevations:

. . $\displaystyle \begin{array}{c}\text{Start} \\ \hline 1000 \\ 1030 \\ 1100 \\ 1150 \\ 1090 \\ 1220 \\ 1500 \\ 1350 \\ 1200 \\ 1092 \\ 1000 \\ \hline \text{End} \end{array}$

Is there a calculation or formula that I can use to determine my total gain and loss
based on my starting elevation of 1000?

We can take the difference of consecutive elevation and see our progress.
. . [Positive = hiking uphill. .Negative = hiking downhill.]

. . $\displaystyle \begin{array}{c}\text{Start} \\ \hline 1000 \\ 1030 \\ 1100 \\ 1150 \\ 1090 \\ 1220 \\ 1500 \\ 1350 \\ 1200 \\ 1092 \\ 1000 \\ \hline \text{End} \end{array} \quad \begin{array}{c} +30 \\ +20 \\ + 50 \\ -60 \\ +130 \\ +280 \\ -150 \\ -150 \\ -108 \\ -92 \end{array}$

We find that we hiked a total of 560 feet uphill
. . and a total of 560 feet downhill.

We should not be surprised that the net distance is zero.
After all, we ended at the same elevation that we started from.

3. I understand how to do the math on paper. My question is more, looking for a equation or formula to calculate a dynamic input of elevation values for a computer program.

So, I wouldn't be doing the math like you showed, I would be inputing a large amount of values like I showed and need those calculated with a final output...