Vectors — Direction and Magnitude
The mathematical objects that have both a size and a direction
Drag the Arrow
The canvas shows a coordinate grid with vector A drawn as an arrow from the origin. Drag its arrowhead, or move the 'Magnitude' slider and then the 'Angle' slider. The dashed circle marks every point at the same length, and the arc at the origin shows the angle θ, measured counterclockwise from the positive x-axis.
Components Form a Right Triangle
With components on, dashed lines drop from the tip of A to each axis, labelled x and y. These two legs and the arrow form a right triangle, with A as the hypotenuse. Toggle the 'Components' button to hide them: the arrow stays put, because the components describe the same vector, not a different one.
Decomposition
The cards under the canvas track x = |A|cos θ and y = |A|sin θ as you drag. Cosine projects the length onto the horizontal axis and sine onto the vertical, so every vector is a mix of cosine and sine. Going the other way, |A| = √(x² + y²) and θ = atan(y / x) recover length and direction from the components.
Worked Example: A = (3, 4)
Take components x = 3 and y = 4. The magnitude is |A| = √(3² + 4²) = √(9 + 16) = √25 = 5, and the direction is θ = atan(4 / 3) ≈ 53.1°. Now set the 'Magnitude' slider to 5.0 and the 'Angle' slider to 53°: the cards read x ≈ 3.009 and y ≈ 3.993, and the tip lands on the grid point (3, 4).
Adding and Subtracting
Click '+ Vector B' to add a second arrow with its own 'B Magnitude' and 'B Angle' sliders; you can drag its tip too. In 'Addition' mode the dashed parallelogram's diagonal is the resultant A + B, labelled |A+B|. Switch to 'Subtraction' and a dashed −B appears: A − B is simply A + (−B), labelled |A−B|.
Dot and Cross Products
Choose 'Dot Product' and A casts a shadow onto B: A·B = |A||B|cos φ, where φ is the angle between them, so it is positive when they point the same way, zero at 90° and negative beyond. Choose 'Cross Product' and the shaded parallelogram's area equals |A×B| = |A||B|sin φ, largest when the arrows are perpendicular.
How It Works — Step by Step
-
1
Drag the Arrow
The canvas shows a coordinate grid with vector A drawn as an arrow from the origin. Drag its arrowhead, or move the 'Magnitude' slider and then the 'Angle' slider. The dashed circle marks every point at the same length, and the arc at the origin shows the angle θ, measured counterclockwise from the positive x-axis.
-
2
Components Form a Right Triangle
With components on, dashed lines drop from the tip of A to each axis, labelled x and y. These two legs and the arrow form a right triangle, with A as the hypotenuse. Toggle the 'Components' button to hide them: the arrow stays put, because the components describe the same vector, not a different one.
-
3
Decomposition
The cards under the canvas track x = |A|cos θ and y = |A|sin θ as you drag. Cosine projects the length onto the horizontal axis and sine onto the vertical, so every vector is a mix of cosine and sine. Going the other way, |A| = √(x² + y²) and θ = atan(y / x) recover length and direction from the components.
-
4
Worked Example: A = (3, 4)
Take components x = 3 and y = 4. The magnitude is |A| = √(3² + 4²) = √(9 + 16) = √25 = 5, and the direction is θ = atan(4 / 3) ≈ 53.1°. Now set the 'Magnitude' slider to 5.0 and the 'Angle' slider to 53°: the cards read x ≈ 3.009 and y ≈ 3.993, and the tip lands on the grid point (3, 4).
-
5
Adding and Subtracting
Click '+ Vector B' to add a second arrow with its own 'B Magnitude' and 'B Angle' sliders; you can drag its tip too. In 'Addition' mode the dashed parallelogram's diagonal is the resultant A + B, labelled |A+B|. Switch to 'Subtraction' and a dashed −B appears: A − B is simply A + (−B), labelled |A−B|.
-
6
Dot and Cross Products
Choose 'Dot Product' and A casts a shadow onto B: A·B = |A||B|cos φ, where φ is the angle between them, so it is positive when they point the same way, zero at 90° and negative beyond. Choose 'Cross Product' and the shaded parallelogram's area equals |A×B| = |A||B|sin φ, largest when the arrows are perpendicular.
Key Takeaways
Two Properties
A vector has both magnitude (how big) and direction (which way). A number that only has magnitude is called a scalar.
Component Form
Any vector A can be written as (x, y) where x = |A|cos(θ) and y = |A|sin(θ). This is called the component form.
Right Triangle
The vector, its x-component, and its y-component always form a right triangle. The Pythagorean theorem gives: |A|² = x² + y².
Building Block
Vectors are the foundation of linear algebra, physics forces, computer graphics, and machine learning. Nearly every STEM field uses them.
Connected Concepts
Dot Product
Measures how aligned two vectors are.
Sine
Used to decompose vectors into components.
Law of Cosines
Treat two triangle sides as vectors from the same corner, and the third side is just their difference.
Bézier Curves
A Bézier curve is built by blending control-point vectors with (1 − t)A + tB again and again until one point traces the curve.
The Catenary
Split each link's tension into horizontal and vertical components, and balancing them joint by joint draws a hanging chain's curve.
Vector Fields
A vector field puts one vector at every point of the plane, like wind or force arrows drawn across a map.
Updated
- — New connection to Vector Fields, which place one vector at every point of the plane.
- — New connection to The Catenary.
- — New connection to Bézier Curves, where blending vectors traces a smooth curve.
- — Six steps that name the drag, sliders and the four modes, a worked example A = (3, 4), and a new quiz question