Example #1
0
 /**
  * Calculate stride length for activity
  * Use this method if trackdata is not available
  * @param \Runalyze\Model\Activity\Entity $activity
  * @return int [cm]
  */
 public static function forActivity(Activity\Entity $activity)
 {
     if ($activity->cadence() > 0 && $activity->duration() > 0) {
         return round($activity->distance() * 1000 * 100 / ($activity->cadence() * 2 / 60 * $activity->duration()));
     }
     return 0;
 }