/** * Subtracts another velocity from this instance and returns a new instance * with the difference. * * @param Velocity $b Velocity to subtract * * @return static Difference of the two velocity instances */ public function sub(Velocity $b) { $dist = $this->dist->sub($b->dist); $velocity = new Velocity($dist, $this->time); $velocity->format = $this->format; return $velocity; }