コード例 #1
0
 public Double calculateSpeed(NavigationPosition other) {
   if (getTime() != null && other.getTime() != null) {
     double interval =
         abs(getTime().getTimeInMillis() - other.getTime().getTimeInMillis()) / 1000.0;
     Double distance = calculateDistance(other);
     if (distance != null && interval > 0.0) return distance / interval * 3.6;
   }
   return null;
 }
コード例 #2
0
 public Long calculateTime(NavigationPosition other) {
   if (getTime() != null && other.getTime() != null) {
     return other.getTime().getTimeInMillis() - getTime().getTimeInMillis();
   }
   return null;
 }