Vector Calculator

Calculate 2D and 3D vectors with formulas and a live graph.

Vector A
Vector B
Examples:
Calculated result
53.1301°
Angle

Interactive vector graph

2D · drag A or B

Drag either arrow tip to change its components. The shaded angle and calculations update automatically.

Show calculation steps & formulas

Vector Calculator with Steps, Graphs and Formulas

A vector calculator helps you work with quantities that have both magnitude and direction. Vectors appear in school mathematics, engineering, physics, computer graphics, mechanics and linear algebra. Instead of working out each component by hand, you can enter two vectors and let this vector solver show the result, formula and a diagram. Our calculator for vectors works for two-dimensional and three-dimensional vectors, so it is suitable for everything from a displacement question to a cross product in engineering mathematics.

The main calculator above supports addition, subtraction, magnitude, unit vectors, dot product, cross product, angles, projection, parallel and orthogonal tests, perpendicular vectors, and linear combinations. It also includes point-based geometry and matrix multiplication. This makes it useful as an introductory vector cal or vector calculator mathway alternative for common classroom exercises, although it is not a general-purpose computer algebra system.

How to use the Vector Calculator

Choose 2D or 3D, select an operation, enter components for A and B, and press Calculate. The blue arrow represents A and the purple arrow represents B. In 2D, you can also drag the arrow tips to change the vectors. The tool displays the computed answer, relevant supporting values, and a worked explanation. Switch to Points & Direction to work from coordinates or use Matrix & Eigen for matrix-vector multiplication and supported eigenvalue problems.

What Is a Vector in Mathematics?

A vector is an object with direction and size. In two dimensions we usually write A = (aₓ, aᵧ). In three dimensions we write A = (aₓ, aᵧ, aᵥ). The component notation tells you how far the vector moves along each axis. For example, A = (3, 4) describes a displacement of 3 units horizontally and 4 units vertically. A position vector starts at the origin and ends at a point with those coordinates. A free vector describes the same displacement regardless of its starting position.

Vectors differ from scalars. Mass, temperature and elapsed time are common scalar examples because they have size but not a spatial direction. Velocity, displacement, force and acceleration are vector quantities. A magnitude and direction of a vector calculator therefore answers two related questions: how long is the arrow, and where does it point?

How to Calculate the Magnitude of a Vector

The magnitude of a vector formula comes directly from the Pythagorean theorem. For A = (x, y), take the square root of x² + y². For three components, include z². The vector magnitude calculator applies this equation for you and shows the substitution. In the default example A = (3, 4), the length is √(9 + 16) = 5. This is the same right-triangle relationship students learn in coordinate geometry.

|A| = √(aₓ² + aᵧ²)   (2D)   |A| = √(aₓ² + aᵧ² + aᵥ²)   (3D)

When studying how to calculate magnitude of a vector, remember that the result cannot be negative. The zero vector has magnitude zero and does not have a defined direction or unit vector. A vector with components (−3, −4) also has magnitude 5 because squaring removes the component signs. Its direction, however, differs from (3, 4).

Unit Vector Calculator and Unit Vector Formula

A unit vector has magnitude 1. To find it, divide each component of A by its magnitude. This is called normalizing the vector. Our unit vector calculator uses the unit vector formula  = A / |A|. For A = (3, 4), the unit vector is (0.6, 0.8). The vector still points in exactly the same direction, but its length becomes 1.

If A = (0, 0), division by zero makes normalization impossible. The calculator reports the unit vector as undefined rather than returning an incorrect zero direction. Unit vectors are widely used in force resolution, motion models, computer graphics, collision calculations and other 2D/3D problems.

Vector Addition, Net Vector and Resultant Vector

Vector addition combines corresponding components. If A = (3, 4) and B = (4, 0), then A + B = (7, 4). Physically, the result may represent the net displacement from two movements or the combined effect of two forces. A net vector calculator is useful when all forces or movements have already been written in component form. For several vectors, add the x components together, the y components together, and any z components together.

A + B = (aₓ + bₓ, aᵧ + bᵧ, aᵥ + bᵥ)

The graphical rule is called head-to-tail addition. Place the tail of B at the tip of A, then draw the resultant from the starting point to the final tip. The parallelogram method gives the same answer. When subtracting, use A − B = A + (−B), which means reversing B and then adding. This is particularly helpful for relative velocity and the displacement between two positions.

Dot Product of Two Vectors and Scalar Product Formula

The dot product of two vectors, also called the scalar product, produces one number rather than another vector. Multiply corresponding components and add them: A · B = aₓbₓ + aᵧbᵧ + aᵥbᵥ. This is the dot product formula. For A = (3, 4) and B = (4, 0), the dot product is 3 × 4 + 4 × 0 = 12.

A · B = |A| |B| cos θ = aₓbₓ + aᵧbᵧ + aᵥbᵥ

A scalar product calculator or calculator dot product can also be used to check whether two nonzero vectors are perpendicular. Their dot product must be zero. The geometric version of the formula explains why: cos 90° = 0. Dot products appear in work done by a force, projections, lighting calculations, and finding an angle between vectors.

How to Calculate the Angle Between Two Vectors

To learn how to calculate angle between two vectors, first find the dot product and the magnitude of each vector. Then rearrange A · B = |A||B|cos θ to obtain θ = arccos[(A · B)/(|A||B|)]. A vector angle calculator gives an angle between 0° and 180°. In the default vectors (3, 4) and (4, 0), the angle is about 53.13°.

θ = cos⁻¹ [ (A · B) / (|A| × |B|) ]

Positive dot products correspond to acute angles, negative dot products to obtuse angles, and zero to a right angle for nonzero vectors. The formula is undefined if either vector has length zero. The calculator carefully clamps the cosine to the interval [−1, 1] to avoid small floating-point errors at nearly parallel vectors.

Cross Product Calculator and Cross Product Formula

The cross product formula produces a vector perpendicular to both input vectors. In three dimensions, A × B = (aᵧbᵥ − aᵥbᵧ, aᵥbₓ − aₓbᵥ, aₓbᵧ − aᵧbₓ). The result follows the right-hand rule. The magnitude of the cross product equals |A||B|sin θ, which represents the area of the parallelogram formed by A and B.

A × B = (aᵧbᵥ − aᵥbᵧ, aᵥbₓ − aₓbᵥ, aₓbᵧ − aᵧbₓ)

For 2D vectors, the calculator embeds A = (aₓ, aᵧ, 0) and B = (bₓ, bᵧ, 0) in 3D, then reports the z component aₓbᵧ − aᵧbₓ. This signed scalar indicates counterclockwise or clockwise orientation and is frequently used in 2D geometry. The cross product has applications in torque, rotational mechanics, surface normals and 3D graphics.

Vector Projection Formula

The projection vector formula answers how much of A points in the direction of B. The vector projection is projB(A) = [(A · B)/(B · B)] B. The scalar component is (A · B)/|B|, which can be negative. A vector projection calculator helps resolve motion or force into a chosen direction and is useful in mechanics and linear algebra.

projB(A) = [(A · B) ÷ |B|²] × B

Projection is undefined when B is zero because B supplies the direction. The calculator checks this case. Also note that projection and the dot product are not interchangeable: the dot product gives a scalar, while the vector projection returns a vector parallel to B. The scalar component differs from the magnitude of the projection because the component retains the sign.

Parallel Vector Calculator and Orthogonal Vector Calculator

A parallel vector calculator checks whether one nonzero vector is a scalar multiple of another. In two dimensions this can be tested by aₓbᵧ − aᵧbₓ = 0. In three dimensions, parallel vectors have a zero cross product. They may point in the same direction or opposite directions. The calculator uses a small numerical tolerance for rounded decimal inputs instead of demanding impossible machine-precision equality.

An orthogonal vector calculator checks the dot product. If A · B = 0 and neither vector is zero, the vectors meet at 90°. Orthogonal vectors need not have unit magnitude. In the example A = (3, 0) and B = (0, 4), the dot product is zero even though their lengths are 3 and 4.

A perpendicular vector calculator 3d needs additional care. In 2D, one perpendicular to (x, y) is (−y, x). In 3D infinitely many directions are perpendicular to a nonzero vector. This tool chooses an axis that is not parallel to A and takes a cross product to find one suitable perpendicular vector; it does not imply that the chosen vector is unique.

Linear Combination and Linearly Independent Vector Calculator

A linear combination of vector calculator evaluates expressions such as αA + βB, where α and β are numbers. Each output component is αaᵢ + βbᵢ. For example, 2(3,4) − (4,0) = (2,8). Linear combinations underpin vector spaces, systems of equations, basis vectors and transformations.

A linearly independent vector calculator for two vectors can determine whether one vector is a scalar multiple of the other. In 2D, a nonzero determinant proves independence. In 3D, a nonzero cross product does the same. The zero vector makes any set containing it linearly dependent. This simple check applies to the two vectors provided; larger sets require matrix rank and other linear algebra tools.

Position Vector Calculator, Terminal Point and Slope

The position vector calculator 3d uses coordinates to describe displacement from the origin or between two points. If P = (1, 2, 0) and Q = (5, 6, 3), the displacement Q − P is (4, 4, 3). The length of that displacement is the straight-line distance between the points. A terminal point of a vector calculator performs the inverse operation: if a vector v starts at P, its terminal point is P + v.

For two-dimensional coordinates, the slope of a vector calculator computes rise/run, or (y₂ − y₁)/(x₂ − x₁). If the horizontal change is zero and the vertical change is nonzero, the slope is undefined. The direction angle from the positive x-axis comes from atan2(dy,dx). The Points & Direction mode shows both the displacement and the slope where applicable.

Vector Diagram, Vector Plotter and 3D Vector Planes

A picture often makes vector arithmetic easier to understand. The built-in vector plotter displays A, B, and sometimes the calculated resultant or projection. The blue and purple arrows always begin at the origin in the main mode. For addition, the green result arrow represents A + B. In the point-based mode the line runs between P and Q. When using 2D vectors, the graph has equal mathematical scales on its x and y axes and permits dragging the arrow tips.

In three dimensions the graph shows an isometric-style projection of the axes and vectors. It is a 2D drawing of three-dimensional coordinates, not a full rotatable 3D graphics engine. Searches such as vector planes and vector calculator 3d may involve plane equations, normals and linear algebra; the calculator supports 3D components and perpendicular vector operations, while full plane-intersection solving belongs in a separate geometry tool.

Matrix Multiplication with Vector Calculator

The matrix multiplication with vector calculator multiplies a 2×2 or 3×3 matrix by a compatible vector. Each result component is the dot product of one matrix row with the input vector. If M = [[2,1],[1,2]] and v = (1,2), then Mv = (4,5). This operation appears in rotations, scaling, linear transformations, systems of equations and computer graphics.

(Mv)ᵢ = Σ Mᵢⱼ vⱼ

A matrix can stretch, rotate, reflect or shear vectors. If the input vector's direction remains unchanged and is only scaled, it may be an eigenvector. However, ordinary matrix-vector multiplication alone does not calculate eigenvalues; the next section explains the separate relationship.

Eigenvalue and Eigenvector Calculator

An eigen value eigen vector calculator solves Mv = λv for nonzero v, where λ is an eigenvalue. The associated eigenvector points in a direction preserved by the matrix transformation. Related searches include eigenvalue and eigenvector calculator, eigen value and eigen vector calculator, eigen vector calculator, and find the eigen values and eigen vectors of the matrix. These are fundamentally matrix questions rather than simple vector arithmetic.

The Matrix & Eigen tab provides a carefully limited eigenvalue calculator 3×3 for real symmetric 3×3 matrices and a general real 2×2 eigensolver. Real symmetric 3×3 matrices have real eigenvalues and an orthonormal eigenvector basis, making them suitable for a reliable Jacobi rotation method in JavaScript. A general non-symmetric 3×3 matrix may have complex eigenvalues and needs a more comprehensive algebra system. This page explicitly reports the limitation instead of inventing an answer.

For 2×2 matrices, the eigenvalues solve λ² − tr(M)λ + det(M) = 0. The calculator provides real eigenvectors when real eigenvalues exist, and reports a complex conjugate pair if the characteristic polynomial has a negative discriminant. This makes eigenvalue calculation an optional extra rather than distracting from the everyday vector operations.

Vector Formulas Summary

OperationFormulaType of result
AdditionA + B = (aₓ + bₓ, aᵧ + bᵧ, ...)Vector
SubtractionA − B = (aₓ − bₓ, aᵧ − bᵧ, ...)Vector
Magnitude|A| = √(Σaᵢ²)Nonnegative scalar
Unit vector = A / |A|Vector
Dot productA · B = ΣaᵢbᵢScalar
Cross productA × B3D vector / 2D z component
Anglecos⁻¹[(A · B)/(|A||B|)]Degrees
Projection[(A · B)/|B|²]BVector
Linear combinationαA + βBVector

Worked Vector Calculation Examples

Example 1: Find magnitude and unit vector

Let A = (6, 8). Square the components: 36 + 64 = 100. The square root is 10, so |A| = 10. Divide the components by 10 to obtain the unit vector (0.6, 0.8). The calculated vector is in the same direction as A but its length is exactly 1.

Example 2: Dot product and angle

Let A = (1, 0) and B = (0, 1). The dot product is 1 × 0 + 0 × 1 = 0. Both vectors have magnitude 1. Therefore cos θ = 0/1 = 0 and θ = 90°. They are orthogonal. A different example, A = (1, 0) and B = (−1, 0), gives cos θ = −1 and θ = 180°, so the vectors are antiparallel.

Example 3: Cross product in 3D

Let A = (1, 0, 0) and B = (0, 1, 0). Applying the cross product formula gives A × B = (0, 0, 1). This result points along the positive z-axis and is perpendicular to both A and B. Reversing the inputs gives B × A = (0, 0, −1), illustrating why the order matters for cross products.

Example 4: Projection onto another vector

Let A = (3, 4) and B = (4, 0). The dot product equals 12 and |B|² equals 16. The multiplier is 12/16 = 0.75, so the projection onto B is 0.75(4, 0) = (3, 0). Its scalar component is 3. This separates the horizontal contribution from A's vertical component.

Example 5: Displacement from initial to terminal coordinates

If P = (2, −1) and Q = (7, 3), subtract coordinates to get Q − P = (5, 4). The magnitude is √(25 + 16) = √41 ≈ 6.4031. The line's slope is 4/5 = 0.8 and its direction angle is about 38.66° measured counterclockwise from the positive x-axis.

Common Mistakes When Calculating Vectors

  • Adding magnitudes instead of components when two vectors point in different directions.
  • Confusing the dot product (scalar) and cross product (vector).
  • Reversing the cross-product order: A × B = −(B × A).
  • Dividing by zero while calculating a unit vector, angle or projection.
  • Mixing degrees with radians when manually evaluating trigonometric formulas.
  • Treating a projected 3D drawing as if its screen angles were the true spatial angles.
  • Assuming every eigenvector computation is a simple vector operation; it is a matrix eigenproblem.

Vector Calculator Frequently Asked Questions

1. How do I calculate a vector?

Enter x and y components for 2D or x, y and z components for 3D. Select magnitude, addition, dot product, cross product, angle, projection or another operation. The calculator displays the formula and result.

2. How do you find the magnitude of a vector?

Square each component, add the squares and take the square root. For (3, 4), the answer is 5.

3. How do I find the angle between two vectors?

Use cos θ = (A · B)/(|A||B|) and take the inverse cosine. Neither vector may have zero magnitude.

4. When are two vectors orthogonal?

Two nonzero vectors are orthogonal when their dot product is zero. Their angle is 90°.

5. When are vectors parallel?

Two nonzero vectors are parallel when one is a scalar multiple of the other. Their cross product is zero in 3D.

6. How do I calculate a unit vector?

Divide each component by the original vector's magnitude. A zero vector cannot be normalized.

7. Can I calculate a cross product in 2D?

Yes. The calculator treats the two 2D vectors as lying in the xy-plane and reports the z component of their 3D cross product.

8. What is the difference between vector projection and scalar projection?

Vector projection gives the portion of A parallel to B as a vector. Scalar projection gives its signed length along B.

9. Does the calculator support 3D vectors?

Yes. Switch dimensions to 3D to calculate three-component vector operations and view a projected diagram.

10. Can I drag vectors on the graph?

In 2D mode, drag the arrow tips to update the components and calculated result. The 3D view is a fixed projection and is not draggable.

11. How do I calculate the slope of a vector?

For a 2D vector (x, y), the slope is y/x if x is nonzero. Vertical vectors have undefined slope. Use Points & Direction for initial and terminal coordinates.

12. What is a linear combination of vectors?

It is an expression such as 2A − B, where each vector is multiplied by a scalar and the results are added component-wise.

13. Can I calculate matrix eigenvalues and eigenvectors?

Yes, for all real 2×2 matrices and real symmetric 3×3 matrices. General nonsymmetric 3×3 matrices are outside the supported eigenanalysis scope.

14. What does an eigenvector represent?

For a matrix M, an eigenvector v is a nonzero vector satisfying Mv = λv. Its direction is unchanged by the transformation, apart from possible reversal when λ is negative.

15. Is this tool useful for physics and engineering?

Yes. The formulas support forces, displacement, velocity components, unit directions, torque, normal vectors and basic linear algebra assignments.

Practice with the Free Online Vector Calculator

Use this free vector calculator to check arithmetic and understand the geometry behind each result. You can test 2D and 3D examples, change components, compare parallel or orthogonal vectors, and read the worked explanation without creating an account. The combination of a calculator, a visual plotter and clear formulas makes it helpful for students reviewing vector mathematics in India and around the world.