Skip to content
FastTool

Science & Math

3D Vector Calculator

Enter two vectors to get the angle between them, their dot and cross products, and the projection of A onto B. Add a point P to find its distance to the plane the two vectors span. Every result is drawn in 3D with the working shown.

Try a problem

01 / YOUR COORDINATES

Start with A and B.

Vector A
Vector B

Use the same unit for every component. Each value must be 0 or between 10⁻⁹ and 10⁶ in size. Angles are in degrees and areas in squared units.

Loading the calculator…

TIP-TO-TAIL ADDITIONA + B = (3, 4, 0)
ABResultZ up, right-handed axes

Drag to rotate. Click the view, then scroll or press + and − to zoom. Arrow keys rotate it too.

Angle between A and B—undefined for zero vectors
Dot product A · B—sum of paired components
Triangle area—½ |A × B| in squared units

All arrows share one scale except the unit normal, which is drawn longer so you can see it. The transparent patch stands for an infinite plane through the origin.

All results from the current coordinates
QuantityResult

How it works

Follow the calculation.

1. Multiply or add?

Add components to find a resultant vector. The dot product instead returns a scalar, useful for finding angles and resolving a vector along a direction.

A · B = AxBx + AyBy + AzBz

For a force in newtons and a displacement in meters, the dot product is the work done in joules. The calculator treats every value as a plain number, so keep units consistent.

2. Separate along and across.

Projection gives the part of A parallel to B. Subtract it from A to get the perpendicular remainder. B must be nonzero.

projB(A) = (A · B / |B|²) B

Choose “Resolve a vector”: A = (4,3,0), B = (2,0,0). The along component is (4,0,0) and the perpendicular component is (0,3,0).

3. Find the shortest path.

A × B points perpendicular to both directions. Normalize it to define a plane normal. Project P onto that normal to get the signed distance to the plane through the origin.

n = (A × B) / |A × B|
d = P · n; Q = P − dn

The 3–4 triangle has area 6. Its plane is z = 0; P = (1,1,5) is 5 units away and its closest point is (1,1,0).

Worked example: a tilted plane.

Choose “Oblique plane”: A = (3, 1, 2), B = (−1, 3, 1) and P = (2, 2, 4).

A · B = −3 + 3 + 2 = 2
A × B = (−5, −5, 10), |A × B| = √150 ≈ 12.247

The angle between A and B is about 80.73°, and triangle OAB has area ≈ 6.124. The unit normal is (−0.408, −0.408, 0.816), so P · n ≈ 1.633: P sits 1.633 units from the plane, and its closest point is (2.667, 2.667, 2.667).

A plane that misses the origin.

The plane here always passes through the origin. For a plane through another point P₀, enter two directions along the plane as A and B, and enter P − P₀ as the point.

d = (P − P₀) · n
Q = P − d n

The distance is the same as for the shifted point. Add P₀ back to the closest point if you need its real position.

How do I find the angle between two vectors?

Divide the dot product by the product of the lengths and take the arccosine: θ = arccos(A · B ÷ (|A| |B|)). For A = (4, 3, 0) and B = (2, 0, 0) that is arccos(8 ÷ 10) ≈ 36.87°. The calculator uses an equivalent atan2 form, which stays accurate near 0° and 180°.

Does the order of A and B matter?

Not for the dot product. For the cross product it does: B × A = −(A × B). Swapping A and B flips the normal, so the signed plane distance changes sign. The triangle area and the distance itself stay the same.

What does the length of A × B tell me?

It equals the area of the parallelogram with sides A and B, and half of it is the area of triangle OAB. For A = (3, 0, 0) and B = (0, 4, 0), A × B = (0, 0, 12), so the triangle area is 6.

Why do some results say “undefined”?

A zero vector has no direction, so its angle and any projection onto it are undefined. Parallel vectors don’t span a unique plane. We also skip the plane results when the vectors are so close to parallel (normalized cross-product length 10⁻¹⁰ or less) that rounding would decide the answer. Every other result still shows.

What is in the downloads?

The JSON file has the three input vectors, every result, the formulas used and the numeric limits. The CSV file has one row per vector or value. Undefined results are null in JSON and “undefined” in CSV. Runs in your browser. Nothing is uploaded.

Sources

Methods follow OpenStax Calculus Volume 3: the dot product and projections and the cross product. Results use double-precision arithmetic, so a value that should be 0 can occasionally show as a tiny number such as 1e-16.

Found a mistake? Tell us.