Vector Calculator

See how two vectors combine, align and separate into parallel and perpendicular parts. Enter Cartesian components, inspect dot and cross products, compare directions, and connect each result to a diagram, a calculation explanation and a complete export.

Vector geometry

See how your vectors relate

Enter two vectors

Each dimension keeps its own draft. All components use the same coordinate scale.

Vector A
Vector B
Try an example
Paste components

Enter exactly 2 numbers per vector, separated by commas or spaces. Parentheses or square brackets are optional. Applying invalid text leaves your current vector intact.

Explore a result

Dot product

12

The signed sum of component products. The diagram resolves A along B. A has a component opposite B when the dot product is negative.

Angle, approximate

53.1301°

An acute angle

Spanned parallelogram area

≈ 16

Product units; half this area is the spanned triangle.

Products are exact for the entered decimals. Displayed vector components, magnitudes and angles are shortened; exact components and full approximations are in the ledger.

Dot product: 12. An acute angle.

Explore the geometry

Dot product: vectors A and B in the XY planeVector coordinates use one common display scale. X and Y axes use equal scales. The full coordinate ledger follows the diagram.XYABProjectionRejection0

Blue A and pink B start at the origin. Green is the projection; dashed purple is the rejection, when the target is nonzero. X and Y use the same scale; very small features may be below pixel resolution.

Vector results and coordinates

Exact values refer to the entered decimals. Roots, directions and angles are approximate.

All components share one coordinate scale. Dot and cross products have product units; projections keep the input units. If the components are lengths, product units are squared lengths. Unit directions are dimensionless.

All vector results, with exact components and approximate magnitudes
QuantityExact componentsMagnitude, approximate
Acomponent units(3, 4)5
Bcomponent units(4, 0)4
A + Bcomponent units(7, 4)8.062257748
A − Bcomponent units(-1, 4)4.123105626
B − Acomponent units(1, -4)4.123105626
A × Bproduct units(0, 0, -16)16
A projected onto Bcomponent units(3, 0)3
Rejection of A from Bcomponent units(0, 4)4
B projected onto Acomponent units(36/25, 48/25)2.4
Rejection of B from Acomponent units(64/25, -48/25)3.2
Full scalar values and unit directions
Full scalar calculation values and normalized directions
QuantityValue
Dot product, exact12
2D signed determinant, exact-16
Parallelogram area, approximate16
Triangle area, approximate8
Angle, approximate degrees53.13010235415598
Angle, approximate radians0.9272952180016122
180° minus angle, computed independently126.86989764584402
Signed angle minus 90°, computed independently-36.86989764584402
A: exact squared magnitude25
B: exact squared magnitude16
A + B: exact squared magnitude65
A − B: exact squared magnitude17
B − A: exact squared magnitude17
A × B: exact squared magnitude256
A projected onto B: exact squared magnitude9
Rejection of A from B: exact squared magnitude16
B projected onto A: exact squared magnitude144/25
Rejection of B from A: exact squared magnitude256/25
A: approximate unit direction(0.6, 0.8)
B: approximate unit direction(1, 0)
A + B: approximate unit direction(0.8682431421244593, 0.49613893835683387)
A − B: approximate unit direction(-0.24253562503633297, 0.9701425001453319)
B − A: approximate unit direction(0.24253562503633297, -0.9701425001453319)
A × B: approximate unit direction(0, 0, -1)
A projected onto B: approximate unit direction(1, 0)
Rejection of A from B: approximate unit direction(0, 1)
B projected onto A: approximate unit direction(0.6, 0.8)
Rejection of B from A: approximate unit direction(0.7999999999999999, -0.6)
A onto B: exact coefficient; approximate signed scalar component3/4; 3
B onto A: exact coefficient; approximate signed scalar component12/25; 2.4
Coordinates and calculation steps
Unprojected diagram coordinates; 2D points are embedded at Z equals zero
PointApproximate X, Y, Z
Origin(0, 0, 0)
Tip of A(3, 4, 0)
Tip of B(4, 0, 0)
Tip of A + B(7, 4, 0)
Tip of A − B(-1, 4, 0)
Tip of B − A(1, -4, 0)
A onto B(3, 0, 0)
B onto A(1.44, 1.92, 0)
Unit normal (dimensionless)(0, 0, -1)
  1. Add and subtract components

    (a ± b)ᵢ = aᵢ ± bᵢ

    a + b = (7, 4); a − b = (-1, 4); b − a = (1, -4).

  2. Dot product

    a · b = Σ aᵢbᵢ

    12 + 0 = 12.

  3. Signed determinant and out-of-plane normal

    a × b = (aᵧb_z − a_zbᵧ, a_zbₓ − aₓb_z, aₓbᵧ − aᵧbₓ)

    a × b = (0, 0, -16); the z component is the signed 2D determinant.

  4. Angle between directions

    θ = atan2(|a × b|, a · b), 0 ≤ θ ≤ π

    θ = 53.13010235415598°; π − θ = 126.86989764584402°; θ − 90° = -36.86989764584402°.

  5. Resolve a along and perpendicular to b

    proj_b(a) = (a · b) / (b · b) × b; rejection = a − projection

    Coefficient = 3/4; projection = (3, 0); rejection = (0, 4).

  6. Resolve b along and perpendicular to a

    proj_a(b) = (b · a) / (a · a) × a; rejection = b − projection

    Coefficient = 12/25; projection = (36/25, 48/25); rejection = (64/25, -48/25).

The cards shorten long values for reading. Exact fractions and full approximate values remain here and in CSV; additional digits do not remove uncertainty in measured inputs.

View CSV text

Focus the text to select it, then copy. This is the same dataset as the download. Keep fraction columns as text when importing into a spreadsheet.

Method, precision and limits

Vectors use Cartesian coordinates in one common orthonormal basis. Dot products sum matching component products; cross products use the right-hand convention. Projection separates a source into a part along the target and a perpendicular rejection. The geometry is calculated from the same results used in the tables and CSV.

Each component may be zero or a signed decimal with magnitude up to 10¹², up to 24 significant digits and 24 decimal places. Blank fields, expressions and unsupported precision are rejected. Separate 2D and 3D drafts remain intact when you change dimensions. No units are converted or inferred.

Decimal sums, products and projection fractions are exact for the entered numbers. Square roots, normalized directions and angles are approximations. Exact zero products determine classifications; an angle near 90° or 180° keeps a meaningful offset instead of becoming a false right or straight angle. A zero vector is valid but has no unit direction or angle; projecting onto zero is undefined.

Screen projections may collapse an edge-on or extremely small feature. They are explanations, not a substitute for the coordinate ledger. The cross product has product units, so its normalized direction is drawn separately from the input vectors.

Sources: OpenStax: dot products, angles and projections; OpenStax: cross products and spanned area.

How to use this calculator

  1. Choose two or three dimensions and enter each component of vectors A and B in a common Cartesian coordinate system. Components may be positive, negative or zero. Each dimension retains its own draft.
  2. Choose a result to inspect: a dot or cross product, angle, sum, difference or either projection direction. A projection is directional: A onto B and B onto A generally differ.
  3. Use the diagram to connect the result to the vectors. The spatial view is an orthographic projection; change the viewing direction or inspect a coordinate plane. Use numeric results for actual 3D lengths and angles.
  4. Inspect exact products, the component ledger and the calculation steps. Read undefined-result explanations for zero vectors and the warning when a geometric feature is too small to distinguish on screen.
  5. Download the complete CSV or open its selectable text. Exact algebraic values and approximate magnitudes, directions and angles are identified separately.

The Formula

The mathematical logic powering this calculation is:

A · B = Σ AᵢBᵢ. |A| = √(A · A).
A × B = (AᵧB𝓏 − A𝓏Bᵧ, A𝓏Bₓ − AₓB𝓏, AₓBᵧ − AᵧBₓ). In 2D, embed both vectors at Z = 0; the signed determinant is the resulting Z component.
For nonzero vectors, θ = atan2(|A × B|, A · B), with 0° ≤ θ ≤ 180°.
Projection of A onto nonzero B = [(A · B)/(B · B)]B. The perpendicular remainder is A minus that projection. The signed scalar component is (A · B)/|B|.
The spanned parallelogram area is |A × B|; the corresponding triangle area is half as large. A unit direction is A/|A| when A is nonzero.

Worked Example

If you input:

  • Dimensions: 2D — X and Y
  • Vector A, X: 3
  • Vector A, Y: 4
  • Vector B, X: 4
  • Vector B, Y: 0

Result:

For A = (3,4) and B = (4,0), the dot product is 12 and the angle is approximately 53.13010235°. A + B = (7,4) and A − B = (−1,4). The magnitudes are 5 and 4. Projecting A onto B gives (3,0), with signed scalar component 3 and perpendicular remainder (0,4). The embedded cross product is (0,0,−16), so the signed 2D determinant is −16, parallelogram area is 16 and triangle area is 8.

Frequently Asked Questions

What is the difference between a dot product and a cross product?

The dot product is a scalar that combines corresponding components and measures alignment. In three dimensions, the cross product is a vector perpendicular to both inputs, with orientation determined by the right-hand rule and magnitude equal to their spanned parallelogram area. Swapping the inputs preserves the dot product and reverses the cross product.

What does a cross product mean for two-dimensional vectors?

The calculator embeds each 2D vector as (X,Y,0). Its cross product has only a Z component, equal to AₓBᵧ − AᵧBₓ. That signed determinant describes orientation in the XY plane; its absolute value is the parallelogram area. It is not a two-component vector lying in the original plane.

What is vector projection, and why can its scalar component be negative?

Projecting A onto B extracts the part of A parallel to the line defined by B. The remaining vector is perpendicular to B, and the two parts add back to A. The scalar component is signed relative to B’s direction: a negative value points opposite to B. Its absolute value is the projection’s magnitude. Reversing the projection direction usually changes the result.

Can I enter a zero vector?

Yes. Sums, differences, dot products and cross products remain defined. A zero vector has no unit direction, so the angle involving it is undefined. Projection onto a zero vector is also undefined. A zero source projected onto a nonzero target is a valid zero projection. These cases are reported separately instead of invalidating unrelated results.

Are the displayed answers exact?

Entered decimal components are retained for exact rational addition, products and projection coefficients. Exact algebraic values are available in the ledger and export. Square roots, unit directions and angles are numerical approximations. Compact display values are rounded and do not imply measurement accuracy. Near-zero angles and positive differences from 180° or 90° are retained when ordinary rounding would conceal them.

Why do lengths and angles look different in the 3D diagram?

A flat screen shows a projection of three-dimensional geometry. A vector pointing toward the viewer can look short or disappear in a coordinate-plane view even though its actual magnitude is nonzero. Use the view controls, coordinate ledger and numeric angle to distinguish projection from the full geometry. Unit-direction views are explicitly normalized; their arrow lengths do not represent original magnitudes.

Which inputs and coordinate systems are supported?

Use two or three real components in one orthonormal Cartesian basis. Each component may have absolute value at most 10¹², up to 24 significant digits and 24 effective decimal places; zero is allowed and scientific notation is accepted. Fractions, partial numbers and unsupported precision are rejected. The calculator does not infer physical units or convert spherical, cylindrical, geographic or non-orthogonal coordinates.

Can I use the results for forces, work or torque?

Vector operations can describe those quantities when your physical model and units are consistent. This calculator treats the components as numbers. Dot and cross products multiply the input units; unit directions are dimensionless, and geometric area interpretations require compatible length units. It does not choose forces, verify equilibrium, size a component or assess an engineering design.

Similar Calculators