Vector sum, dot, and cross product
Adds any number of 2D or 3D vectors head to tail; for two vectors, also their difference, dot and cross products, the angle between them, and the projection of one on the other.
Planning and education aid. Not for primary navigation. Full disclaimer
The resultant has a magnitude of 5.
- Resultant x
- Resultant y
- Resultant direction
- Unit vector
- Convention
Provenance
- Computed by
- navigation.vector.operations 1.0.0, core 0.1.0
- Model
- Component-wise sums; a·b = Σ aᵢbᵢ; a × b = (a_y b_z − a_z b_y, a_z b_x − a_x b_z, a_x b_y − a_y b_x); angle = acos(a·b / |a||b|); projection = a·b / |b|
- Accuracy
- Exact arithmetic. All vectors must share one unit; the tool does not convert them
- Notes
- None
- Cites
- Karney, C. F. F., GeographicLib, GeographicLib Geocentric and LocalCartesian classes
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Component-wise sums; a·b = Σ aᵢbᵢ; a × b = (a_y b_z − a_z b_y, a_z b_x − a_x b_z, a_x b_y − a_y b_x); angle = acos(a·b / |a||b|); projection = a·b / |b|
Show your work
Add the components
Σ x, Σ y, Σ zx: 3 + -1 + 2; y: 4 + 2 + -3= (4, 3)Resultant magnitude
√(4² + 3² + 0²)= 5
The same steps an agent gets from the MCP server with explain: true.
Accuracy: Exact arithmetic. All vectors must share one unit; the tool does not convert them
When to use this: Use this to add vectors head to tail -- a wind triangle, a set of forces, a chain of offsets -- and, for two of them, to get their difference, dot and cross products, the angle between them and the projection of one on the other, all in one place and one convention.
Limitations: Every vector must already be in the same unit: this adds numbers and does not convert them. A zero resultant has no direction, and the angle to a zero vector is undefined; both are reported as such rather than as zero. The cross product is a three-dimensional operation -- for two 2D vectors what comes back is its scalar z-component, which is the signed area of the parallelogram they span, not a vector.
Worked example: Three vectors head to tail. Source: Component-wise sum: (4, 3), magnitude 5, direction 053.1301° from north. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.
You enter
- Vectors
- 3, 4 -1, 2 2, -3
You get
- Resultant magnitude
- 5
- Resultant x
- 4
- Resultant y
- 3
- Resultant direction
- 53.1301°
- Unit vector
- (0.8, 0.6)
- Convention
- Directions clockwise from north (+y); x is east, y is north, z is up.
Review: Not yet independently reviewed by a geodesist.
Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Checked against: 22 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- GeographicLib Geocentric and LocalCartesian classes, Karney, C. F. F., GeographicLib, GeographicLib 2.x. Geocentric.cpp: geodetic to ECEF; LocalCartesian.cpp: the east-north-up rotation. Read free.