HexMathv1.0.4

Vector calculator

This vector calculator finds the magnitude of a vector, adds, subtracts and scales vectors, and computes the dot product, the cross product and the angle between two vectors. Type the vectors or scan the problem. HexMath returns the result and shows the working component by component, in two or three dimensions.

Loading math input...

What this page covers

  • The magnitude (length) of a vector in 2 or 3 dimensions.
  • Adding, subtracting and scaling vectors.
  • The dot product, the angle between two vectors, and the cross product in 3 dimensions.
  • Not covered here: matrices acting on vectors (see the matrix multiplication calculator) and vector-valued functions in calculus (type the problem into the solver).

How to enter the problem

  • Type it or paste it. Write a vector as ⟨2, −3, 6⟩ or (2, −3, 6), and name the operation, such as magnitude, dot product or cross product.
  • Scan it. Fit the one problem in the frame.
  • Choose a photo. Several problems in one photo are solved as a list.
  • Then tap Solve.

Worked examples

Example 1: Find the magnitude of ⟨2, -3, 6⟩.

Problem

Find the magnitude of ⟨2,−3,6⟩\displaystyle \langle 2, -3, 6 \rangle.

Answer

Verified

The answer is

77

Explanation

  1. Write the formula
    For ⟨a,b,c⟩\langle a, b, c \rangle the magnitude is a2+b2+c2\sqrt{a^2 + b^2 + c^2}.
  2. Square each component
    22=42^2 = 4, (−3)2=9(-3)^2 = 9, 62=366^2 = 36. Squaring removes the sign.
  3. Add and take the square root
    4+9+36=494 + 9 + 36 = 49, so the magnitude is 49=7\sqrt{49} = 7.
  4. Check the size
    The magnitude must be at least the largest component, 66, and at most the sum 2+3+6=112 + 3 + 6 = 11. 77 is.

Example 2: Let θ be the angle between a = ⟨1, 1, 0⟩ and b = ⟨0, 1, 1⟩. Find cos θ.

Problem

Let θ\displaystyle \theta be the angle between a=⟨1,1,0⟩\displaystyle \mathbf{a} = \langle 1, 1, 0 \rangle and b=⟨0,1,1⟩\displaystyle \mathbf{b} = \langle 0, 1, 1 \rangle. Find cos⁡θ\displaystyle \cos\theta.

Answer

Verified

The answer is

cos⁡θ=12\cos\theta = \frac{1}{2}

Explanation

  1. Find the dot product
    a⋅b=1⋅0+1⋅1+0⋅1=1\mathbf{a} \cdot \mathbf{b} = 1 \cdot 0 + 1 \cdot 1 + 0 \cdot 1 = 1
  2. Find the magnitudes
    ∥a∥=2\|\mathbf{a}\| = \sqrt{2} and ∥b∥=2\|\mathbf{b}\| = \sqrt{2}.
  3. Use the angle formula
    cos⁡θ=a⋅b∥a∥∥b∥=12\cos\theta = \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{a}\|\|\mathbf{b}\|} = \frac{1}{2}
  4. Name the angle if you need it
    cos⁡θ=12\cos\theta = \frac{1}{2} means θ=π3\theta = \frac{\pi}{3}, which is 60∘60^\circ.

Example 3: Find p × q for p = ⟨2, 0, 1⟩ and q = ⟨1, 3, -1⟩.

Problem

Find p×q\displaystyle \mathbf{p} \times \mathbf{q} for p=⟨2,0,1⟩\displaystyle \mathbf{p} = \langle 2, 0, 1 \rangle and q=⟨1,3,−1⟩\displaystyle \mathbf{q} = \langle 1, 3, -1 \rangle.

Answer

Verified

The answer is

(−336)\begin{pmatrix}-3\\ 3\\ 6\end{pmatrix}

Explanation

  1. Write the formula
    p×q=⟨p2q3−p3q2, p3q1−p1q3, p1q2−p2q1⟩\mathbf{p} \times \mathbf{q} = \langle p_2 q_3 - p_3 q_2,\ p_3 q_1 - p_1 q_3,\ p_1 q_2 - p_2 q_1 \rangle
  2. First component
    0⋅(−1)−1⋅3=−30 \cdot (-1) - 1 \cdot 3 = -3
  3. Second component
    1⋅1−2⋅(−1)=31 \cdot 1 - 2 \cdot (-1) = 3
  4. Third component
    2⋅3−0⋅1=62 \cdot 3 - 0 \cdot 1 = 6
  5. Check perpendicularity
    ⟨−3,3,6⟩⋅p=−6+0+6=0\langle -3, 3, 6 \rangle \cdot \mathbf{p} = -6 + 0 + 6 = 0 and ⟨−3,3,6⟩⋅q=−3+9−6=0\langle -3, 3, 6 \rangle \cdot \mathbf{q} = -3 + 9 - 6 = 0.

Common mistakes

  • Adding the components instead of squaring them for the magnitude. 2−3+6=52 - 3 + 6 = 5 is not the length of ⟨2,−3,6⟩\langle 2, -3, 6 \rangle; the length is 4+9+36=7\sqrt{4 + 9 + 36} = 7.
  • Losing a minus sign when squaring a negative component: (−3)2=9(-3)^2 = 9.
  • Getting the middle component of the cross product backwards. It is p3q1−p1q3p_3 q_1 - p_1 q_3, not p1q3−p3q1p_1 q_3 - p_3 q_1.
  • Treating the dot product as a vector. It is a single number.

Checks, assumptions and limits

  • Check a cross product by dotting it with both original vectors. Each result must be 0, because the cross product is perpendicular to both.
  • Angles from the dot product are between 00 and π\pi (0° and 180°). The cross product is defined for vectors in 3 dimensions.
  • HexMath can make mistakes. Double check important steps.

Frequently asked questions

Yes. Give both vectors and ask for the angle. The steps find the dot product and the magnitudes, then the inverse cosine, in radians or degrees as you ask.

Use angle brackets or round brackets with commas, such as ⟨1, 2, 3⟩ or (1, 2, 3). Name each vector if the problem uses more than one.

Yes. Ask in the same thread, for example why the cross product is perpendicular. A typed follow-up needs sign-in.

Yes, for vectors in 3 dimensions. The steps write out each component of the cross product, and the result is a vector perpendicular to both.

Ready to solve your next math problem?

Create a free account for 3 math questions a day in your browser. No card.

Get HexMath on your phone

The same solver and camera scan on iPhone and Android.

Last updated: · HexMath