Vector Calculator for 2D and 3D Operations
This vector calculator works out the common operations on vectors — quantities with both magnitude and direction — for both 2D (x, y) and 3D (x, y, z) space. Enter the components of vector A (and B when needed), pick an operation, and the answer updates instantly with a graph alongside it.
It covers everything from addition and subtraction to the dot product, cross product, angle between vectors, projection, magnitude, unit vector, and scalar multiplication. That makes it useful for students checking homework as well as anyone working with physics, engineering, or computer graphics.
How to Use the Vector Calculator
Choose 2D or 3D
Use the Dimension toggle at the top to switch between 2D and 3D. In 3D mode an extra z field appears for each vector.
Enter your vectors
Type the components for Vector A and, for two-vector operations, Vector B. Each card shows its magnitude (|A|, |B|) below the inputs as you type.
Pick an operation
Choose a Two Vectors operation (add, subtract, dot, cross, angle, projection) or a Single Vector one (magnitude, unit vector, scalar multiplication). The cross product appears only in 3D mode.
Read the result and steps
The answer appears instantly: a vector as coordinates, a scalar as a single number, or an angle in both degrees and radians. Open Show formula & steps to see the formula and a worked breakdown, and copy the result with one click.
Features
Real-Time Calculations
Results update the moment you change a value or operation — there is no separate calculate button to press.
Interactive Visualization
A coordinate plane draws color-coded arrows for A, B, and the result, with zoom in, zoom out, and reset controls.
Step-by-Step Solutions
Expand the formula panel to see the exact formula used and each intermediate step that leads to the answer.
Comprehensive Operation Set
Add, subtract, dot product, cross product, angle, projection, magnitude, unit vector, and scalar multiplication in one place.
Scalar Multiplication Presets
Quick buttons for −1, 2, 0.5, and 10 let you reverse, double, halve, or scale a vector without typing.
2D and 3D Modes
Switch between 2D and 3D vectors with one toggle; the cross product unlocks automatically in 3D.
Dark Mode Support
The interface and visualization colors adapt to your dark mode preference for comfortable viewing.
Copy Results
Copy any answer to your clipboard in coordinate form, ready to paste into notes or other apps.
Frequently Asked Questions
How do you calculate the dot product of two vectors?
Multiply the matching components and add them up: for 2D, A · B = AxBx + AyBy; for 3D, add the AzBz term too. The result is a single number (a scalar). Select the A · B operation and the calculator does this for you, with the worked steps available below.
What is the difference between the dot product and the cross product?
The dot product (A · B) returns a scalar and measures how much two vectors point the same way; it equals |A||B|cos θ. The cross product (A × B) returns a vector perpendicular to both inputs, with magnitude |A||B|sin θ. The cross product is only defined for 3D vectors.
How do you find the magnitude (length) of a vector?
Square each component, add them together, and take the square root: |A| = √(x² + y²) in 2D, or √(x² + y² + z²) in 3D. The calculator shows each vector's magnitude live beneath its inputs, and the |A| operation displays it as the main result.
How do you find the angle between two vectors?
Use the dot product formula θ = arccos((A · B) / (|A| · |B|)). Choose the ∠(A,B) operation and the result is shown in both degrees (0° to 180°) and radians (0 to π).
What is a unit vector and how do you normalize a vector?
A unit vector has a length of exactly 1 while keeping the original direction. You normalize by dividing each component by the magnitude: Â = A / |A|. A zero vector has no direction, so it cannot be normalized — the calculator shows an error if you try.
Does the cross product only work in 3D?
Yes. The cross product produces a vector perpendicular to both inputs, which needs a third dimension to exist in. For that reason the A × B button appears only in 3D mode; in 2D there is no perpendicular direction for the result to point.
What does vector projection mean?
The projection of A onto B (projBA) is the part of A that lies along the direction of B — like the shadow A casts on B. It is calculated as ((A · B) / |B|²) × B. Projecting onto a zero vector is undefined, so the calculator flags that case.
Can I use negative numbers and decimals?
Yes. Every component can be positive, negative, zero, or a decimal; negative values simply point along the negative axis. Results display up to four decimal places with trailing zeros trimmed, while internal calculations keep full floating-point precision.
No comments yet. Be the first to comment!