The Dimensions of A steppers (▲ / ▼) set the rows and columns of A, each from 1 to 5; C takes the same shape automatically. Learn more about choosing dimensions
▶ Play runs the sweep, Next → and ← Back move one cell at a time, Reset returns to the opening scene, and the speed menu sets the pace from Slow to Very Fast. Learn more about the controls
Each scene lights one entry of A and its destination in C, with an arrow between them and ci,j=k⋅ai,j as its title. Learn more about reading a scene
The Step explanations log keeps every completed step with its formula and a note linking to the matching section below. Learn more about the step log
Symbolic visualization of k · A = C, cell by cell.
Dimensions of A?A scalar is a single number — not a vector or matrix. Multiplying by a scalar k preserves shape: the result has the same dimensions as the input, and every entry equals k times the corresponding input entry. The same idea applies to vectors and to matrices — only the shape of the operand differs.
A2×3
k·
A2×3
a1,1
a1,2
a1,3
a2,1
a2,2
a2,3
=
C2×3
?
?
?
?
?
?
Step 1 / 8
Step explanations
1Scalar multiplication
k is a scalar — a single number. To compute C = k · A, multiply every cell of A by k. C has the same shape as A (2×3).
Element-wise operation — applied independently to each entry; the result at (i,j) depends only on k and ai,j.
Shape preservation — kA has the same dimensions as A. Scalar multiplication never changes the shape.
Scaling factor — the role k plays: it stretches (∣k∣>1), shrinks (∣k∣<1), or flips sign (k<0) every entry uniformly.
Zero scalar — multiplying by k=0 produces the zero matrix of the same shape as A.
Getting Started with the Visualizer
DemoShape, play, reset
Step 0 of 5
Set the shape of A and watch kA=C build one cell at a time.
• Use the Dimensions steppers to set the shape of A (1 to 5 in each direction) • C inherits the same shape automatically • Hover the ? icon for a reminder of what a scalar is and why the shape is preserved • Press play or step manually through the scene player; the speed selector and step log let you control pace and review
The scalar k is shown symbolically in front of A. The visualizer focuses on the structural rule — every cell of A gets multiplied by the same k — not on any specific numerical value of k.
Reading the Scene Player
DemoReading one scene
Step 0 of 5
Each scene focuses on one cell of C.
• The active cell in A is highlighted primary; the destination cell in C is highlighted accent • A curved arrow flows from ai,j into ci,j, showing the scalar being applied • Each filled cell of C shows its symbolic content k⋅ai,j • The step log on the right keeps a record of completed cells
By the final scene, every cell of C holds its symbolic product and the operation is complete.
The Opening Scene: One Number and One Matrix
The player starts with the scalar k, the matrixA, and an empty C waiting for the result. At the default dimensionsA is 2×3, so C will be 2×3 as well.
Only the setup is on screen: a single number on one side, six entries on the other, and the statement that C=k⋅A is about to be built cell by cell.
Opening scene, frozen
The scalar k beside A at 2×3, with C empty. Every cell of C shows the placeholder - no shape precondition to satisfy, since k meets each entry on its own.
Unlike addition, this operation has no matching-shape precondition — there is nothing to match. A scalar can multiply a matrix of any dimensions, because it meets every entry individually rather than pairing off against a second grid.
That also fixes the output shape immediately. C has exactly the dimensions of A, whatever k happens to be, and no choice of k can add or remove an entry.
One Cell at a Time
Each step highlights a single entry of A together with its destination in C, and writes k⋅ai,j into that slot.
The frozen picture below is a step partway through the 2×3 run: some cells of C already hold their scaled value, one is being computed, and the rest are still placeholders.
Mid-sweep, frozen
One entry of A and its destination in C highlighted together. Earlier cells of C already hold k times their entry; later ones are still placeholders.
The same k is used at every step. That is the entire content of the operation — six multiplications that share one factor — and it is why scalar multiplication is so much simpler than the matrix product, where each output entry consumes a whole row and a whole column.
Because each cell is independent, the order of the sweep is again a presentational choice. Nothing in c2,3 depends on c1,1 having been computed first.
The Completed Product
The final scene fills every cell, so C reads ci,j=k⋅ai,j throughout, at the same 2×3 shape it started with.
Written that way the defining property is visible at a glance: one factor, applied everywhere.
Completed product, frozen
All six cells filled with k times the entry above, and C still 2×3. One factor, applied everywhere.
The algebraic rules all follow from that. Scalar multiplication distributes over matrix addition, k(A+B)=kA+kB, and over scalar addition, (k+m)A=kA+mA; it is associative with scalars, (km)A=k(mA); and 1⋅A=A while 0⋅A is the zero matrix. Those are precisely the axioms that make the set of 2×3 matrices a vector space.
Two consequences are worth knowing because they are easy to get wrong. The trace scales linearly, tr(kA)=ktr(A), since every diagonal entry picks up one factor of k. The determinant does not: for an n×n matrix, det(kA)=kndet(A), because the determinant collects one factor of k from each of the n rows. Doubling a 3×3 matrix multiplies its determinant by eight, not by two.
Choosing Dimensions
DemoAny shape works
Step 0 of 5
The dimension steppers control the shape of A, and C follows automatically.
• Start with 2×2 or 2×3 to see the per-cell flow clearly • Increase to 4×4 or 5×5 to see how the same rule scales — total scenes equal m×n • Symbolic content in C shrinks automatically as the matrix grows, so k⋅ai,j stays readable • Square and rectangular shapes follow identical rules — scalar multiplication has no shape restriction
What Scalar Multiplication Is
Scalar multiplication takes a number k and a matrix A and produces a matrix kA of the same shape, with every entry multiplied by k:
(kA)i,j=k⋅ai,j
It's the simplest non-trivial matrix operation. There are no shape restrictions — any matrix can be scaled. The result is the same shape as A, and every cell depends only on k and its own value in A.
Scalar multiplication is the multiplicative companion to matrix addition: both are element-wise, both preserve shape, and together they make matrices into a vector space.
• Associativity with scalars: (kl)A=k(lA) • Distributivity over matrix addition: k(A+B)=kA+kB • Distributivity over scalar addition: (k+l)A=kA+lA • Identity scalar: 1⋅A=A • Zero scalar: 0⋅A=0 (zero matrix of the same shape) • Sign flip: (−1)⋅A=−A • Compatibility with transpose: (kA)T=kAT • Compatibility with matrix multiplication: k(AB)=(kA)B=A(kB)
These properties are exactly the eight vector-space axioms for scalar multiplication.
Why It Matters
Scalar multiplication is the operation that lets matrices form a vector space, and it appears everywhere combinations of matrices appear.
• Linear combinations: any expression c1A1+c2A2+⋯+cnAn uses scalar multiplication • Normalization: dividing A by a norm or a trace is scalar multiplication by 1/∥A∥ or 1/tr(A) • Sign changes: −A is just scalar multiplication by −1 • Scaling transformations: in geometry, kA applied to a vector scales the result uniformly • Differential equations and physics: scaling the coefficient matrix of a system rescales the solution • Gradient descent and optimization: the step θ←θ−η∇L uses scalar multiplication of the gradient by the learning rate η
Worked Example
Take A as a 2×3 matrix and k=3:
A=(10−254−3)
Then 3A multiplies every entry by 3:
3A=(30−61512−9)
With k=−1 instead:
−A=(−102−5−43)
And with k=0, the result is the 2×3 zero matrix.
Set the visualizer to 2×3 and step through to see this animated symbolically.
Common Mistakes
A few mistakes recur.
• Multiplying only the first entry or only the diagonal — k multiplies every entry, not a privileged subset • Confusing scalar multiplication with the Hadamard product — kA uses a single number; Hadamard product uses an entire matrix of multipliers • Confusing scalar multiplication with matrix multiplication — there is no row-column pairing; scalar multiplication is purely element-wise • Thinking the shape changes — kA always has the same shape as A, regardless of k • Forgetting sign flips count as scalar multiplication — −A is (−1)⋅A
Related Concepts
Matrix addition — the element-wise additive operation; pairs with scalar multiplication to make matrices a vector space.
Hadamard product — element-wise multiplication of two matrices; the matrix-by-matrix analogue of scalar multiplication.
Matrix multiplication — the standard non-element-wise product; very different from scalar multiplication.
Linear combination — c1A1+⋯+cnAn, the central object built from scalar multiplication and addition.
Vector space — the abstract structure matrices form under addition and scalar multiplication.
Norm — multiplying A by 1/∥A∥ produces a unit-norm matrix.
Zero matrix — the result of multiplying any matrix by the scalar 0.