Example #1
0
 /**
  * Get gradient
  * @return string gradient in percent with percent sign
  */
 public function gradientInPercent()
 {
     if ($this->Activity->distance() == 0) {
         return '-';
     }
     return round($this->Activity->elevation() / $this->Activity->distance() / 10, 2) . ' %';
 }
Example #2
0
 /**
  * Calculate VDOT by heart rate with elevation influence
  * @return float
  */
 public function calculateVDOTbyHeartRateWithElevation()
 {
     if ($this->knowsRoute()) {
         if ($this->Route->elevationUp() > 0 || $this->Route->elevationDown() > 0) {
             return $this->calculateVDOTbyHeartRateWithElevationFor($this->Route->elevationUp(), $this->Route->elevationDown());
         }
         return $this->calculateVDOTbyHeartRateWithElevationFor($this->Route->elevation(), $this->Route->elevation());
     }
     return $this->calculateVDOTbyHeartRateWithElevationFor($this->Activity->elevation(), $this->Activity->elevation());
 }