At a glance
Two arrows a and b in a plane can be mixed with a pair of numbers to build new vectors, and those numbers change when the arrows do. This sim lets you build vectors, test when two arrows are enough, and measure how much of one lies along another: the real-number groundwork for expanding a quantum state in a basis.
What you'll learn
- How a vector is built from two others, and what the coefficients c₁ and c₂ tell you.
- When two vectors are enough to reach the whole plane, and how the determinant tests it.
- How the inner product gives lengths and angles, and how a projection splits a vector into two parts.
- Which kind of basis lets you read a component straight off with an inner product.
What's on screen
- a and b (blue, green): the two vectors. Drag their pulsing tips to move them.
- v (pink): the combination c₁a + c₂b, with its dashed parallelogram (Linear Combination view).
- ê₁ and ê₂ (sky, violet): the standard basis, (1, 0) and (0, 1).
- proj (amber) and a violet angle arc: the projection of a onto b and the angle θ (Dot Product & Projection view).
- Sidebar readouts: the arithmetic behind each view, line by line.
The controls
Press ⌖ on a row to see where that control sits in the sim.
| Control | What it changes | Range | |
|---|---|---|---|
| Vectors a, b | The components of a and b. Type them, or drag the tips on the canvas (dragging snaps to 0.5). | −10 to 10 opens at a = (3, 1), b = (1, 3) | |
| View tabs | Switch between Linear Combination and Dot Product & Projection. Each has its own readouts and overlays. | 2 views opens on Linear Combination | |
| c₁, c₂ | The coefficients in v = c₁a + c₂b. Linear Combination view only. | any number opens at 1 and 1 | |
| Standard basis ê₁, ê₂ | Draws the two unit arrows (1, 0) and (0, 1) at the origin, in both views. | on / off opens on | |
| Show parallelogram | Draws the parallelogram whose diagonal is v. Linear Combination view only. | on / off opens on | |
| Show projection | Draws proj, the part of a along b, and the dashed guide from a to it. Dot Product & Projection view only. | on / off opens on | |
| Show angle arc | Draws the arc for the angle θ between a and b. Dot Product & Projection view only. | on / off opens on | |
| Readouts | The sidebar arithmetic. Linear Combination view: v and det(a, b), with a basis check. Dot Product & Projection view: ⟨a, b⟩, θ and the projection. | panel | |
| Zoom | Scroll over the canvas to zoom. Changing a vector re-fits the view. | about ±1 to ±55 | |
| Reset | Restores the opening vectors, c₁ = c₂ = 1 and all four overlays, and returns to Linear Combination. | top bar |
Fixed: the space is real (ℝ²), so every component and coefficient is a real number. Nothing animates, so there is no Play button.
Components belong to a basis
A linear combination takes c₁ of a and c₂ of b and adds them tip to tail. The sim adds one coordinate at a time:
- The pair (c₁, c₂) is a recipe written for the set {a, b}. It is not the vector. With a = (3, 1), b = (1, 3) and c₁ = c₂ = 1 the recipe builds v = (4, 4).
- The same recipe with {ê₁, ê₂} builds (1, 1), a different arrow. Going the other way, the arrow (4, 4) needs c₁ = c₂ = 1 in {a, b} but c₁ = c₂ = 4 in {ê₁, ê₂}.
Two vectors reach the plane only if independent
The set of everything c₁a + c₂b can reach is the span of {a, b}. If b = 2a, then c₁a + c₂b = (c₁ + 2c₂)a, so every combination lies on one line.
- det(a, b) = aₓby − aybₓ. Its size |det| is the area of the parallelogram, and det = 0 means that area has collapsed.
- When det ≠ 0, {a, b} is a basis: every vector in the plane has exactly one pair (c₁, c₂). At the opening pair, det = 3·3 − 1·1 = 8.
- The sim shows ✓ valid basis, and switches to ✕ linearly dependent once |det| falls below 0.05.
The inner product gives length and angle
- ⟨a, b⟩ is one number built from two vectors. Its sign says whether they lean the same way (positive) or opposite ways (negative).
- Dividing by the lengths gives cos θ = ⟨a, b⟩ / (‖a‖‖b‖), the angle the sim reports.
- For two non-zero vectors, ⟨a, b⟩ = 0 means they are orthogonal, θ = 90°.
These sliders move the sim too.
Projection takes the part of a along b
- proj is the point on the line through b nearest to a. What is left, a − proj = (2.40, −0.80), is perpendicular to b. That is the dashed guide.
- Dividing by ⟨b, b⟩ = ‖b‖² removes the length of b. Only its direction matters: replace b by 2b and the scalar halves, so proj stays put.
- If b = (0, 0) there is no direction to project onto. The sim prints proj = (0.00, 0.00) and θ = 0.00° as placeholders.
In an orthonormal basis components are inner products
- If ‖b‖ = 1, then ⟨b, b⟩ = 1 and the projection scalar is just ⟨a, b⟩. Perpendicular unit vectors make every component an inner product.
- ê₁ and ê₂ are orthonormal, so the standard components of v are ⟨ê₁, v⟩ and ⟨ê₂, v⟩.
- The opening pair {a, b} is not orthonormal. For v = (4, 4), ⟨a, v⟩ = 16, yet c₁ = 1.
- Quantum mechanics uses the same step: |ψ⟩ = Σ cₙ|n⟩ with cₙ = ⟨n|ψ⟩ for an orthonormal basis {|n⟩}. This sim is real and shows no probabilities; the complex case adds a conjugate in the inner product.
Where it matters
- Polarizers. A polarizer keeps the component of the light's polarization along its axis, and the transmitted intensity is I₀cos²θ (Malus's law). Take a as the polarization and b as the axis: the opening pair has θ = 53.13°, which passes 0.36 of I₀.
- Spin-½ and qubits. The state lives in a complex two-dimensional space. It is written in a chosen basis, such as spin up and spin down, and the squared moduli of its two components are the outcome probabilities.
- Expanding in eigenstates. A state is expanded in the orthonormal eigenstates of the quantity you measure, with coefficients cₙ = ⟨n|ψ⟩.
The sim itself models none of these. It shows the real-vector geometry they share.
Go deeper: Malus's law from the inner product
Summary
Key points
- {a, b} is a basis of the plane exactly when det(a, b) ≠ 0.
- ⟨a, b⟩ = ‖a‖‖b‖cos θ, and ⟨a, b⟩ = 0 means perpendicular.
- proj = (⟨a, b⟩ / ⟨b, b⟩) b, and a − proj is perpendicular to b.
Common mix-ups
- "The pair (c₁, c₂) is the vector." It is the vector's components in one basis. The same pair in ê₁, ê₂ builds (1, 1), not (4, 4).
- "Any two arrows reach the whole plane." Only if det ≠ 0. At b = 2a every combination lies on one line.
- "A longer b captures more of a." The projection depends on the direction of b only. Doubling b halves the scalar.
Things to try on your own
- With a = (3, 1) and b = (1, 3), find c₁ and c₂ that make v = (4, 0). One of them is negative.
- Set a = (2, 0) and b = (0, 3), then move b's tip until ⟨a, b⟩ turns negative. Note the sign of the scalar.
- Compare proj for b = (1, 3) and b = (−1, −3), and explain the sign of the scalar.