Elecmetric

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

Vector A, x component 3, vector A, y component 4, vector A, z component 0, vector B, x component 1 gives
Length of A, |A|: 5 · Length of B, |B|: 3 · Dot product A · B: 11

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

What remains unverified

Verification register entry

Calculation authorRahul Sharma (author)
Technical reviewNo independent technical review has been carried out
Individual professional approvalNot recorded
Formula referencenot recorded
Standard and editionNot applicable: Pure mathematics or statistics; no electrical standard governs the method
Standard review stateNot applicable
Scope-screening notenot recorded
Cross-check test cases32 reference vectors (tests/reference_vectors.json)
Review datenot recorded
Next review datenot recorded
StatusEngineering 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

A · B = AₓBₓ + AᵧBᵧ + A_zB_z |A| = √(A · A) A × B = (AᵧB_z − A_zBᵧ, A_zBₓ − AₓB_z, AₓBᵧ − AᵧBₓ) angle θ: cos θ = A · B / (|A| |B|) component of A along B = A · B / |B|

Worked example

InputValue
Vector A, x component3
Vector A, y component4
Vector A, z component0
Vector B, x component1
Vector B, y component2
Vector B, z component2
  1. A = (3, 4, 0) B = (1, 2, 2)
  2. |A| = 5 |B| = 3
  3. A · B = 11
  4. A × B = (8, -6, 2), length 10.1980390272
  5. Angle = atan2(|A × B|, A · B) = 42.83342807°
  6. Component of A along B = A · B / |B| = 3.6666666667

Assumptions

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

InputUnitAllowed or shownNote
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,000Leave 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
ResultUnitAllowed or shownNote
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 componentLength of A, |A|Length of B, |B|Dot product A · B
0.34.01123422438.3
0.754.06970514938.75
1.54.272001872739.5
35311
67.2111025509314
1212.6491106407320
3030.2654919008338

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.

More Engineering Mathematics calculatorsAll engineering calculatorsVector Calculator (3D) in Elecmetric

Tell us how to improve this page

This opens your email app. Nothing is sent until you press send.