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.
See how your vectors relate
Explore products, angles and projections, then see the coordinates behind each result.
Enter two vectors
Each dimension keeps its own draft. All components use the same coordinate scale.
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
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.
| Quantity | Exact components | Magnitude, 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
| Quantity | Value |
|---|---|
| Dot product, exact | 12 |
| 2D signed determinant, exact | -16 |
| Parallelogram area, approximate | 16 |
| Triangle area, approximate | 8 |
| Angle, approximate degrees | 53.13010235415598 |
| Angle, approximate radians | 0.9272952180016122 |
| 180° minus angle, computed independently | 126.86989764584402 |
| Signed angle minus 90°, computed independently | -36.86989764584402 |
| A: exact squared magnitude | 25 |
| B: exact squared magnitude | 16 |
| A + B: exact squared magnitude | 65 |
| A − B: exact squared magnitude | 17 |
| B − A: exact squared magnitude | 17 |
| A × B: exact squared magnitude | 256 |
| A projected onto B: exact squared magnitude | 9 |
| Rejection of A from B: exact squared magnitude | 16 |
| B projected onto A: exact squared magnitude | 144/25 |
| Rejection of B from A: exact squared magnitude | 256/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 component | 3/4; 3 |
| B onto A: exact coefficient; approximate signed scalar component | 12/25; 2.4 |
Coordinates and calculation steps
| Point | Approximate 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) |
- Add and subtract components
(a ± b)ᵢ = aᵢ ± bᵢ
a + b = (7, 4); a − b = (-1, 4); b − a = (1, -4).
- Dot product
a · b = Σ aᵢbᵢ
12 + 0 = 12.
- 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.
- Angle between directions
θ = atan2(|a × b|, a · b), 0 ≤ θ ≤ π
θ = 53.13010235415598°; π − θ = 126.86989764584402°; θ − 90° = -36.86989764584402°.
- 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).
- 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
- 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.
- 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.
- 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.
- 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.
- 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
Matrix Calculator
Multiply, add, subtract and transpose matrices, or find a determinant and inverse. Get exact fractions, cell explanations and CSV for matrices up to 4 × 4.
Triangle Calculator
Solve right or oblique triangles from sides and angles. Compare both SSA solutions, inspect scaled geometry, and export sides, angles, area and heights.
System of Equations Calculator
Solve 2–4 simultaneous linear equations with exact fractions, elimination steps, a two-variable graph, and checks for unique, infinite or no solutions.
AC Power & Power Factor Calculator
Calculate AC watts, vars, volt-amps and power factor for single-phase or balanced three-phase loads. Combine leading and lagging loads, compare an ideal target PF and export the ledger.
Polygon Area Calculator
Calculate polygon area from ordered coordinates, subtract cutouts, and inspect perimeter, centroid and point location on a consistently scaled plan.
