Velocity
Velocity is a quantity or state representing movement or change through a space, often encoding its direction and magnitude.
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 position changes in browser animations so elements and canvas particles move at chosen speeds and directions.
- How deep it goes
- Derives distance-over-time, implements fixed-frame and timestamp-based movement, then layers acceleration onto velocity and position updates.
- Examples
- Animates a sliding notification and a confetti shower with changing horizontal and vertical velocities.
- What you can do after
- Build it from scratch with JavaScript animation loops, then add gravity, bouncing, springs, or friction to the motion.
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
- Adapts particle movement to permutation problems by representing velocity as swaps.
- How deep it goes
- Defines subtraction, addition, and scaling for swap velocities, with illustrated operations on permutations.
- Examples
- Uses an eight-city permutation and diagrams of velocity scaling, position subtraction, and position addition.
- What you can do after
- Evaluate and understand how swap sequences transform candidate routes in permutation-based PSO.
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 →
Also covered in
What to know first
- exploitationIn optimization and decision-making, exploitation is selecting an option currently believed, based on available information, to yield high value.
- data explorationData exploration is the systematic examination and summarization of data to understand its structure, distributions, relationships, patterns, anomalies, and quality.
- dimensionA dimension is an independent coordinate or feature axis used to represent points or data; the dimensionality of a representation is the number of such axes or components.
Related concepts
- particle swarm optimizationused by · Particle swarm optimization is a population-based optimization method in which candidate solutions adjust their positions using individual and collective search information.
- accelerationproduced by · Acceleration is the rate at which an object's velocity changes over time.
- gravityconfigured by · Gravity is the attractive interaction between masses that accelerates objects toward one another.
- particlepart of · A particle is an individual entity represented or managed as a unit within a physical or computational model.
Questions about velocity
What is velocity?
Velocity is a quantity or state representing movement or change through a space, often encoding its direction and magnitude.
Which Manning books explain velocity?
Math for Web Design, Optimization Algorithms: AI techniques for design, planning, and control problems, Grokking AI Algorithms, Second Edition and Classic Game Programming on the NES: Make your own retro video game.
What should I know before learning velocity?
Manning books that teach velocity usually introduce exploitation, data exploration, dimension and force first.
What is velocity part of?
Velocity is part of particle. A particle is an individual entity represented or managed as a unit within a physical or computational model.
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.



