velocityFrom method

double velocityFrom(
  1. OffsetPoint other
)

Calculates the velocity between this point and a other (previous) point. Returns 0.0 if timestamps are the same to avoid division by zero.

Implementation

double velocityFrom(OffsetPoint other) => timestamp != other.timestamp
    ? distanceTo(other) / (timestamp - other.timestamp)
    : 0.0;