HexMathv1.0.3

Vector calculator

Type or scan a vector problem. HexMath works it out component by component, step by step.

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 (use Matrix multiplication calculator) and vector-valued functions in calculus (use Vector derivative calculator).

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

Problem

Let u=⟨2,−1,4⟩\displaystyle \mathbf{u} = \langle 2, -1, 4 \rangle and v=⟨1,3,−2⟩\displaystyle \mathbf{v} = \langle 1, 3, -2 \rangle. Find 3u−2v\displaystyle 3\mathbf{u} - 2\mathbf{v}.

Answer

Verified

The answer is

(4−916)\begin{pmatrix}4\\ -9\\ 16\end{pmatrix}

Explanation

  1. Scale the first vector
    3u=⟨6,−3,12⟩3\mathbf{u} = \langle 6, -3, 12 \rangle
  2. Scale the second vector
    2v=⟨2,6,−4⟩2\mathbf{v} = \langle 2, 6, -4 \rangle
  3. Subtract component by component
    ⟨6−2, −3−6, 12−(−4)⟩=⟨4,−9,16⟩\langle 6 - 2,\ -3 - 6,\ 12 - (-4) \rangle = \langle 4, -9, 16 \rangle

Example 2

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

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.

1 math question to try today without signing in, 3 a day signed in, unlimited with Pro.

Ready to solve your next math problem?

Try one problem free in your browser. Create a free account for 3 math questions a day.

Last updated: · HexMath