Vector Calculator
From two vectors A and B in three dimensions, find each length, the dot product, the angle between them, the cross product and its length
Try your own numbers
Estimate only. Not engineering or safety advice. Check the result against the applicable standard and the equipment data, and have a competent engineer review it before it is relied on. Terms of use.
Open in the calculator with these values
About this calculator
This page calculates length of A, |A|, length of B, |B|, dot product A · B and 6 more results from vector A, x component, vector A, y component, vector A, z component, vector B, x component and 2 more inputs. Change any value or its unit and the result updates. The steps below show the working for the default values, so you can check each line against your own method.
Limits of this calculator
Use this to resolve a force or a field into components, to find the angle between two directions, to find the area of the parallelogram two vectors span (the length of the cross product), or to check a hand calculation with the right-hand rule. For phasors given by magnitude and angle use the phasor sum calculator.
Cross-check: 32 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review.
Verification status: Engineering reference
Engineering reference. Formula and method documented and tested against separately coded reference calculations. Not yet Verified: the evidence listed on this page is still needed.
What this calculator checks
- The arithmetic of the published formula for the values you entered, in the units shown.
What remains unverified
- That the inputs suit your application. Take ratings, resistances and constants from the manufacturer data sheet or project specification.
Verification register entry
| Calculation author | Rahul Sharma (author) |
|---|---|
| Technical review | No independent technical review has been carried out |
| Individual professional approval | Not recorded |
| Formula reference | not recorded |
| Standard and edition | Not applicable: Pure mathematics or statistics; no electrical standard governs the method |
| Standard review state | Not applicable |
| Scope-screening note | not recorded |
| Cross-check test cases | 32 reference vectors (tests/reference_vectors.json) |
| Review date | not recorded |
| Next review date | not recorded |
| Status | Engineering reference |
Needed before this calculator can be marked Verified: reviewer name, qualification and review date; exact formula reference; formula source (textbook or standard); next review date.
Formula
Worked example
| Input | Value |
|---|---|
| Vector A, x component | 3 |
| Vector A, y component | 4 |
| Vector A, z component | 0 |
| Vector B, x component | 1 |
| Vector B, y component | 2 |
| Vector B, z component | 2 |
- A = (3, 4, 0) B = (1, 2, 2)
- |A| = 5 |B| = 3
- A · B = 11
- A × B = (8, -6, 2), length 10.1980390272
- Angle = atan2(|A × B|, A · B) = 42.83342807°
- Component of A along B = A · B / |B| = 3.6666666667
Assumptions
- Both vectors are in a right-handed x, y, z system, and the cross product follows the right-hand rule, so B × A is the negative of A × B
- The angle is between 0° and 180°; vectors at 90° have a dot product of zero, and parallel vectors have a cross product of zero
- A vector with all components zero has no direction, so the angle and the component along it are not defined and are shown as a dash with a warning
- The angle is found from the length of A × B and A · B, which stays accurate for angles close to 0° and 180°
- The tool works on plain numbers and does not track units: enter both vectors in the same unit
Use this to resolve a force or a field into components, to find the angle between two directions, to find the area of the parallelogram two vectors span (the length of the cross product), or to check a hand calculation with the right-hand rule. For phasors given by magnitude and angle use the phasor sum calculator.
Inputs and results
| Input | Unit | Allowed or shown | Note |
|---|---|---|---|
| Vector A, x component | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Vector A, y component | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Vector A, z component | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | Leave at 0 for a vector in a flat plane. |
| Vector B, x component | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Vector B, y component | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Vector B, z component | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 |
| Result | Unit | Allowed or shown | Note |
|---|---|---|---|
| Length of A, |A| | (number) | Shown to 10 decimal places | |
| Length of B, |B| | (number) | Shown to 10 decimal places | |
| Dot product A · B | (number) | Shown to 10 decimal places | |
| Angle between A and B (degrees) | (number) | Shown to 8 decimal places | |
| Cross product A × B, x component | (number) | Shown to 10 decimal places | |
| Cross product A × B, y component | (number) | Shown to 10 decimal places | |
| Cross product A × B, z component | (number) | Shown to 10 decimal places | |
| Length of A × B, |A × B| | (number) | Shown to 10 decimal places | |
| Component of A along B, (A · B) / |B| | (number) | Shown to 10 decimal places |
How it is calculated
Each input is converted to the base unit of its quantity, the formula above is applied in the order shown in the worked example, and each result is shown in the unit you choose. Results are held at full precision and rounded only for display, except where a step selects a standard size, as the worked example shows. A value outside its allowed range is refused with a message instead of giving a result.
How the result changes with vector a, x component
| Vector A, x component | Length of A, |A| | Length of B, |B| | Dot product A · B |
|---|---|---|---|
| 0.3 | 4.011234224 | 3 | 8.3 |
| 0.75 | 4.069705149 | 3 | 8.75 |
| 1.5 | 4.2720018727 | 3 | 9.5 |
| 3 | 5 | 3 | 11 |
| 6 | 7.2111025509 | 3 | 14 |
| 12 | 12.6491106407 | 3 | 20 |
| 30 | 30.2654919008 | 3 | 38 |
Other inputs are the same as in the worked example above.
Standards and further reading
Complex numbers, rectangular and polar form and angle conversion are standard mathematics, not the subject of a standard. Standards apply when the result feeds an electrical design, and they set the method there.
Frequently asked questions
What do I need to enter?
Enter vector A, x component, vector A, y component, vector A, z component, vector B, x component, vector B, y component, vector B and z component. Change the unit of a value with its selector and the result stays the same.
What does this calculator assume?
Both vectors are in a right-handed x, y, z system, and the cross product follows the right-hand rule, so B × A is the negative of A × B. The angle is between 0° and 180°; vectors at 90° have a dot product of zero, and parallel vectors have a cross product of zero. A vector with all components zero has no direction, so the angle and the component along it are not defined and are shown as a dash with a warning. The angle is found from the length of A × B and A · B, which stays accurate for angles close to 0° and 180°. The tool works on plain numbers and does not track units: enter both vectors in the same unit.
Which calculators should I use next?
Common next steps are Matrix Calculator (2×2 and 3×3), Phasor Sum and Difference (Polar Inputs), Complex Numbers (Rectangular and Polar) and Trigonometry (Sin, Cos, Tan). The related links at the bottom of this page open them.
How accurate are the results?
Every figure comes from the same tested engine as the Elecmetric calculators and is meant for estimating. 32 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review. Check design values against the standard and the equipment data you work to.
Formula guides and reference
Longer explanations with worked examples and tables, written for the same topic.
- Trigonometry Formulas for Electrical Engineers: Sine, cosine and tangent formulas for engineers: the six trig functions, degrees and radians
- Complex Number Formulas: Polar and Rectangular: Complex number formulas for engineers: rectangular and polar form, conversion with atan2, addition
- AC Circuit Formulas: Reactance and Impedance: AC circuit formulas: RMS and peak, frequency and period, inductive and capacitive reactance
More Engineering Mathematics calculatorsAll engineering calculatorsVector Calculator (3D) in Elecmetric