Velocity

smile.modeling.Velocity
See theVelocity companion class
object Velocity

This companion object of class `Velocity` exists primarily to provide convenience methods for creating new instances of Velocity.

Attributes

Companion
class
Source
Velocity.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Velocity.type

Members list

Type members

Inherited and Abstract types

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def apply(dx: Double, dy: Double): Velocity

Creates a Velocity with the given dx and dy.

Creates a Velocity with the given dx and dy.

Attributes

Source
Velocity.scala
def apply(vector: Pos): Velocity

Creates a Velocity whose dx and dy equal the x and y of the given smile.modeling.Pos, respectively.

Creates a Velocity whose dx and dy equal the x and y of the given smile.modeling.Pos, respectively.

Attributes

Source
Velocity.scala
def average(velocities: Seq[Velocity]): Velocity

Returns the average of all the given velocities. If the given collection is empty, returns smile.modeling.Velocity.Still.

Returns the average of all the given velocities. If the given collection is empty, returns smile.modeling.Velocity.Still.

Attributes

Source
Velocity.scala
def between(from: Pos, to: Pos): Velocity

Returns the smile.modeling.Velocity from one smile.modeling.Pos to another. Its direction points from from towards to, and its speed equals the distance between them.

Returns the smile.modeling.Velocity from one smile.modeling.Pos to another. Its direction points from from towards to, and its speed equals the distance between them.

Attributes

Source
Velocity.scala
def sum(velocities: Seq[Velocity]): Velocity

Returns the sum of all the given velocities. If the given collection is empty, returns smile.modeling.Velocity.Still.

Returns the sum of all the given velocities. If the given collection is empty, returns smile.modeling.Velocity.Still.

Attributes

Source
Velocity.scala

Concrete fields

a zero-speed smile.modeling.Velocity with a direction of `NoDirection`

a zero-speed smile.modeling.Velocity with a direction of `NoDirection`

Attributes

Source
Velocity.scala

Givens

Givens