liveBook · Manning

Velocity

Velocity is a quantity or state representing movement or change through a space, often encoding its direction and magnitude.

How 4 Manning books explain it

Math for Web Design

Velocity is the rate of change of an object's position together with its direction of motion.

How it is used
Drives JavaScript and canvas animations by converting elapsed time into directional position changes.
How deep it goes
Explains time-based position updates, acceleration layering, collisions, springs, friction, and component velocities through runnable animation patterns.
Examples
Demonstrates a sliding notification, accelerated motion, draggable inertia, balloon particles, star fields, and falling confetti.
What you can do after
Build it from scratch in JavaScript by updating positions from velocity and elapsed time, then modifying velocity with simulated forces.

Read how Math for Web Design explains velocity →

Optimization Algorithms: AI techniques for design, planning, and control problems

A sequence of swaps that specifies how a particle's permutation is transformed in permutation-based particle swarm optimization.

How it is used
Represents the swaps that move a particle between candidate routes in permutation-based particle swarm optimization.
How deep it goes
Defines velocity through swaps and explains redefined multiplication, subtraction, and addition with route illustrations.
Examples
Uses an eight-city traveling salesman route and figures showing velocity scaling, position subtraction, and swap application.
What you can do after
Apply it via swap operations to transform a route permutation into another candidate solution.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains velocity →

Grokking AI Algorithms, Second Edition

A velocity is a particle's vector describing the direction and magnitude of its movement through the search space.

How it is used
Guides particle movement during particle swarm optimization’s repeated search for better solutions.
How deep it goes
Explains velocity through inertia, cognitive, and social components, then traces its use in position updates and Python code.
Examples
Uses random starting kicks, particle tables, fireflies, plotted movement, and a worked transition from velocity 1.52 to position (0.52, 10.52).
What you can do after
Apply via Python by calculating component influences, combining them into velocity, and updating each particle’s position.

Read how Grokking AI Algorithms, Second Edition explains velocity →

Classic Game Programming on the NES: Make your own retro video game

Velocity is a signed positional change applied along a spatial axis to determine an object's movement.

How it is used
Moves a bouncing NES ball by applying separate horizontal and vertical values to its sprite coordinates.
How deep it goes
Explains initialization, per-loop position updates, and edge-triggered direction changes in assembly.
Examples
Uses a ball sprite initialized with unit X and Y velocities and reversed at the visible screen edges.
What you can do after
Build it from scratch by storing velocity values, adding them to sprite coordinates, and reversing them at boundaries.

Read how Classic Game Programming on the NES: Make your own retro video game explains velocity →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.