Example #1
0
  public static double Acceleration(
      MeasureInformation CurrentMI,
      MeasureInformation PrevMI,
      SpatialTemporalInformation CurrentTI,
      SpatialTemporalInformation PrevTI) {
    // Acceleration = Velocity change / Time
    double velocityChange = CurrentMI.Speed - PrevMI.Speed;
    long differenceInSeconds = (CurrentTI.MPoint.getTime() - PrevTI.MPoint.getTime()) / 1000;

    if (differenceInSeconds == 0) {
      return 0;
    } else {
      return velocityChange / differenceInSeconds;
    }
  }
Example #2
0
  public static double Jerk(
      MeasureInformation CurrentMi,
      MeasureInformation PrevMI,
      SpatialTemporalInformation CurrentTI,
      SpatialTemporalInformation PrevTI) {
    // Jerk = Acceleration change / Time
    double accelerationChange = CurrentMi.Acceleration - PrevMI.Acceleration;
    long differenceInSeconds = (CurrentTI.MPoint.getTime() - PrevTI.MPoint.getTime()) / 1000;

    if (differenceInSeconds == 0) {
      return 0;
    } else {
      return accelerationChange / differenceInSeconds;
    }
  }
Example #3
0
 public static int SecondsToLag(
     SpatialTemporalInformation CurrentTI, SpatialTemporalInformation PrevTI) {
   return (int) (CurrentTI.MPoint.getTime() - PrevTI.MPoint.getTime()) / 1000;
 }