This companion object of class Velocity exists primarily to provide convenience methods for creating new instances of Velocity.
The object has an alias in the top-level package o1, so it’s accessible to students simply via import o1.*.
Attributes
Members list
Type members
Inherited and Abstract types
The names of the product elements
The name of the type
Value members
Concrete methods
Creates a Velocity with the given dx and dy.
Creates a Velocity with the given dx and dy.
Attributes
Returns the average of all the given velocities. If the given collection is empty, returns Velocity.Still.
Returns the average of all the given velocities. If the given collection is empty, returns Velocity.Still.
Attributes
Returns the sum of all the given velocities. If the given collection is empty, returns Velocity.Still.
Returns the sum of all the given velocities. If the given collection is empty, returns Velocity.Still.
Attributes
Concrete fields
a zero-speed Velocity with a direction of NoDirection
