File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2596,13 +2596,13 @@ function addPosition(position) {
2596
2596
var dtt = ( curr_ts - search_match ) / 1000 ;
2597
2597
2598
2598
// calculate vertical rate
2599
- var rate = ( position . gps_alt - vehicle . positions_alts [ search_matches . length ] ) / dtt ;
2599
+ var rate = ( position . gps_alt - vehicle . positions_alts [ search_matches . length - 1 ] ) / dtt ;
2600
2600
if ( ! isNaN ( rate ) && isFinite ( rate ) ) {
2601
2601
vehicle . ascent_rate = 0.5 * rate + 0.5 * vehicle . ascent_rate ;
2602
2602
}
2603
2603
2604
2604
// calculate horizontal rate
2605
- horizontal_rate_temp = new_latlng . distanceTo ( vehicle . positions [ search_matches . length ] ) / dtt ;
2605
+ horizontal_rate_temp = new_latlng . distanceTo ( vehicle . positions [ search_matches . length - 1 ] ) / dtt ;
2606
2606
if ( ! isNaN ( horizontal_rate_temp ) && isFinite ( horizontal_rate_temp ) ) {
2607
2607
vehicle . horizontal_rate = horizontal_rate_temp ;
2608
2608
}
You can’t perform that action at this time.
0 commit comments