Generated with
This document is part of the ebook for O1 (aka CS-A1110 Programming 1), a course at Aalto University.
This document is part of the ebook for O1 (aka CS-A1110 Programming 1), a course at Aalto University.
o1.world.Velocity
See theVelocity companion class
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
Companion
class
Graph
Reset zoom Hide graph Show graph
Supertypes
Self type
Members list
The names of the product elements
The names of the product elements
Attributes
Inherited from:
Mirror
Attributes
Inherited from:
Mirror
Creates a Velocity
with the given dx
and dy
.
Creates a Velocity
with the given dx
and dy
.
Attributes
Creates a Velocity
whose dx
and dy
equal the x
and y
of the given Pos , respectively.
Creates a Velocity
whose dx
and dy
equal the x
and y
of the given Pos , respectively.
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 a Velocity from two given Pos objects: the direction is determined from the first given Pos towards and the speed equals the distance between the two Pos
es.
Returns a Velocity from two given Pos objects: the direction is determined from the first given Pos towards and the speed equals the distance between the two Pos
es.
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