# Bug in calculating overall climb for all caches.

24 views
Some time ago i suggested that you implemeted "Total climb" which you also did (Thumbs up). But i suspect the calculation is wrong because i suppose to have a total of 431683 meters (average height * number of caches) but my profile page says: 2,312,576 m

//SE81293

The total climb would depend on the order you log your finds, I assume. If you log finds at 0, 1000, 0, 1000, 0 the total climb is not the same as if you logged finds at 0, 0, 0, 1000, 1000.
answered Nov 10, 2014 by (153,610 points)
Total climb is total climb, as of total ascending. This is not ascending + descending statistics. So it doesn't matter in this case 0,1000,0,1000 is equal to 0,0,1000,1000.

And even if it would be like you say, there is a bug. Because there is now way to climb 2.3 million meters in 3715 founds. That would be an average of about 622 meters a cache and all subsequent found would have an increase in altitude.

Sorry, but i still think there is some problems with the formula.
+1 vote
It's called "Travelled elevation", and not "Total climb", with the reason that it's not just ascend that is calculated. Just as pinkunicorn mentions, it depends on the order, and the decend is added as well.

Example, you log caches with these elevations: 50, 150, 100, 200, 0 = 100+50+100+100 = 450 m (corrected from 350).

However, just as you say, it was an unreasonable height difference per find. There was a bug, and the height of your first find was added for every find you made. So basically 623*3715 meters.

This has now been corrected in our development environment, and your total will be 85,252 meters.
answered Nov 11, 2014 by (221,810 points)
edited Nov 11, 2014 by magma1447 (Admin)
With all due respect. If both ascending and descending altitudes are adding up the caches with the suggested altitude and in that particular order would generate a travvelled elevation as of: 50, 150, 100, 200, 0 = 50 + 100 + 50 + 100 + 200 = 500 meters total change in elevation. Assuming we started at sea level climbing to 50m. Now as you easily can see the heights added are 500 meters and therefor the average altitude is 100 meters for the five caches in question. Following that my total change in elevation is 5*100 meters. So if ascending and descending are added up as you say you will indeed get the same result as of multiplying the average height for all caches times the number of caches. If that should be called travelled elevation or total climb i leave to you. However the outcome is still the same no matter the order.
I corrected my math, from = 350m to =450m. The data has been calculated as starting from cache 1, not from starting at 0.

But I do not see how you can say that it's the same as the average times number of caches, which would be the same as the sum of the heights.

Consider that you log 10 caches at 1000 meters, that would then be 0 and not 10*1000 meters. And speaking about order:
10, 100, 10 = 90+90 = 180
10,10,100 = 0+90 = 90
*** edit ***

Clearly one shouldn't comment in the middle of the night ;) I'm not completely correct in my discussion below. But, this is what i was trying to say. If i go from one cache with altitude of 10 meters to another of 10 meters. There are any number of points in between not having an altitude of 10 meters generating a change in elevation which is not included in the total sum of elevation. Therefor caclulating Travelled elevation makes no sense since it will not be correct
because the interval is not continous. Enough said about this, i understand you point of view as well. And at the end your way of calculating also ends up with some sort of statistical number

*** edit ***

Let me put it this way, the travelled elevation does not take into consideration that there are any number of different elevations between two specific caches. The caclulation is not based on a continous interval. If the caches are placed on altitudes 10, 10, 100 meters. I might on my way from the first 10 to the second have to climb a large hill. The information 10, 10, 100 are in fact just telling that the average elevation change between the two 10 meter caches are 0 meters. So what you in fact are doing when you calculate travelled elevation your way is adding up averages of elevation changes. That is not the same as travelled elevation. Travelled elevation is not possible to calculate accurate since there is no way of knowing the elevations between two caches. Adding up average altitudes for logged caches on the other hand is both accurate and a far more interesting number i think. But thats jus me!