Choose 2D or 3D, then enter the components of the two vectors a and b and the coefficients k and l. The formula below is linked to the input fields, so you can also edit the components right inside it.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Magnitude of a vector (from its components)
-
Sum and difference of vectors (add or subtract component by component)
-
Scalar multiple of a vector
-
Dot product (a calculation that turns two vectors into a number)
-
Angle between two vectors
-
Conditions for perpendicular and parallel vectors
-
Unit vector (keeping only the direction)
-
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Just enter the components of the 2D or 3D vectors \(\vec{a}\) and \(\vec{b}\) to get the sum \(\vec{a}+\vec{b}\), the difference \(\vec{a}-\vec{b}\) and the linear combination \(k\vec{a}+l\vec{b}\) at once
- The magnitude \(|\vec{a}|\) is shown both as an exact value with the radical simplified, such as \(\sqrt{20}=2\sqrt{5}\), and as a decimal
- You also get the dot product \(\vec{a}\cdot\vec{b}\), the angle between the vectors \(\theta\) (in degrees and radians, with exact values for special angles such as \(45^{\circ}\)), the unit vectors and a perpendicular/parallel check
- The calculator shows the vectors as columns, just as you would write them by hand, and you can edit the components right inside them
- Components and coefficients can be decimals, negative numbers or fractions such as 3/4
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
When several forces act on an object, their combined effect is the sum of vectors. Splitting the tension of a rope pulled at an angle into horizontal and vertical components and adding them up is exactly this calculation.
In designing bridges and buildings, forces such as the structure's own weight, wind and earthquakes are combined as vectors to find the direction and size of the force on each part. Adding only the sizes and ignoring the directions would lead to a dangerous design, so working with vectors is essential.
In a game, a character's movement is calculated as "position vector + velocity vector", and the direction of the camera and of a flying projectile are all vectors. Unit vectors are used every frame whenever only a direction is needed (direction of travel, direction of view).
The dot product is also the key to lighting. The larger the dot product of the direction a surface faces (its normal vector) and the direction of the light, the more directly the light hits it, and that value sets the brightness on screen. If the dot product is 0 or less, the light does not reach the surface.
A plane's actual path is the sum of its velocity vector in the direction the nose points and the wind's velocity vector. To fly due east with a wind from the north, the nose has to point partly into the wind, and how far to turn it is found by subtracting vectors.
At sea, ships add and subtract the vector of the current to decide which way to steer. Being able to handle speed and time component by component is a strength of vectors.
Search engines and generative AI turn texts into long lists of numbers, that is, vectors. Whether two texts are similar is judged by the angle between their vectors: the closer \(\cos\theta\) is to 1, the more similar they are (cosine similarity).
Online stores' "customers who viewed this also liked" features also turn purchase histories into vectors and look for people and products with small angles between them. Here the direction (the pattern of tastes) matters more than the length (such as how much someone spends in total), which is why measuring by angle works well.
Drones and smartphones work out how much they are tilted from the angle between the gravity vector measured by the accelerometer and a reference direction vector of the device. The screen switching between portrait and landscape is a result of this calculation.
In GPS navigation and surveying, the difference between the coordinates of two points is treated as a vector: its magnitude is the distance and its direction is the bearing. In 3D, just add the height component and the same formulas work as is.
Formulas and figures
Symbols and terms
Symbols
| \(\vec{a}\) | vector a | The symbol for a vector. The arrow over the letter shows that it is a quantity with direction. Some textbooks use bold type instead, as in \(\boldsymbol{a}\); both are the same vector. The directed segment from point A to point B is written \(\overrightarrow{\mathrm{AB}}\) (the vector from A to B). |
| \(a_1,\ a_2,\ a_3\) | a sub one, a sub two, a sub three | The components of vector \(\vec{a}\). The small number at the lower right (the subscript) tells which component it is: \(a_1\) is the step in the \(x\) direction, \(a_2\) in the \(y\) direction and \(a_3\) in the \(z\) direction. Some textbooks use \(x\) and \(y\) as subscripts instead, as in \(\vec{a}=(a_x,\ a_y)\). |
| \(|\vec{a}|\) | magnitude of vector a | The magnitude of vector \(\vec{a}\) (the length of the arrow). It uses the same vertical bars as the absolute value of a real number, with the same idea: drop the direction and look only at the size. The value is always 0 or more. |
| \(\vec{a}\cdot\vec{b}\) | a dot b | The dot product. By convention it is written with a centered dot, and the answer is a number, not a vector. The name "dot product" comes from this symbol. It is also called the scalar product. |
| \(\theta\) | theta | The angle between two vectors. Greek letters are customary for angles, and \(\theta\) is the most common. The angle between vectors is the opening between them when they start at the same point, taken in the range \(0^{\circ}\) to \(180^{\circ}\). |
| \(\cos\theta\) | cosine theta | The cosine of the angle \(\theta\). In a right triangle, it is the adjacent side divided by the hypotenuse, and it takes values from \(-1\) to \(1\). It is the key link between the dot product and the angle. |
| \(\cos^{-1}\) | inverse cosine (arccosine) | The inverse cosine. A function that gives the angle \(\theta\) from the value of \(\cos\theta\), also written \(\arccos\). The \(-1\) at the upper right stands for "the reverse operation", not \(\cos\) to the power of \(-1\). On a calculator, it is the key marked small above cos (often reached with 2nd or SHIFT). |
| \(k,\ l\) | k, l | Real numbers (scalars) that say how many times to multiply a vector. The letter \(k\) is often used for constants. In this calculator you enter them as the coefficients of \(k\vec{a}+l\vec{b}\). |
| \(\vec{0}\) | zero vector | The vector whose components are all 0 (the zero vector). It is a special vector with magnitude 0 and no direction, so there is no angle or unit vector for it. |
| \(\perp\) | is perpendicular to | The symbol for "is perpendicular to". \(\vec{a}\perp\vec{b}\) is read "\(\vec{a}\) is perpendicular to \(\vec{b}\)". The symbol is a drawing of a right angle. |
| \(\parallel\) | is parallel to | The symbol for "is parallel to". \(\vec{a}\parallel\vec{b}\) is read "\(\vec{a}\) is parallel to \(\vec{b}\)". The symbol is two parallel lines side by side. |
| \(\iff\) | if and only if | A symbol that says the left side and the right side are equivalent. It says "the right side is true when the left side is true, and only then", and it is written as a two-way arrow. |
| \(\sqrt{\ }\) | square root | The square root symbol. \(\sqrt{20}\) is "the positive number that gives 20 when squared". Vector magnitudes are written with this symbol, and answers are given in simplest radical form, pulling square factors out of the radical, as in \(\sqrt{20}=2\sqrt{5}\). |
Terms
| vector | A quantity that has both a direction and a size (magnitude). It describes things such as velocity, force and movement, where the size alone is not enough and you also need the direction. It is drawn as an arrow, and moving it without turning it (same direction and length) gives the same vector. |
| scalar | Just a number with no direction (such as a length, weight or temperature). The word is used to tell it apart from a vector. The answer of a dot product is a scalar. |
| directed line segment | A line segment with a direction: the arrow itself, with a set starting point and end point. A vector is what you get by keeping only its direction and length, whatever its position. |
| component form | Writing a vector as a set of numbers that says "how far in the \(x\) direction, how far in the \(y\) direction". Besides writing it in a row, as in \(\vec{a}=(4,\ 2)\), you can also write it as a column vector; the two are equivalent. Many US textbooks use angle brackets, as in \(\langle 4,\ 2\rangle\). In component form, sums and dot products are just number calculations. |
| magnitude | The length of the vector's arrow. It is also called the norm or length, and you find it from the components with \(\sqrt{a_1^{2}+a_2^{2}}\). |
| unit vector | A vector with magnitude 1. Calculating \(\dfrac{\vec{a}}{|\vec{a}|}\) gives a vector in the same direction as \(\vec{a}\) with its length set to 1. It is used when you only want to show a direction. |
| zero vector | The vector \(\vec{0}\) whose components are all 0. Its magnitude is 0 and it has no direction. It appears as the difference of a vector and itself, as in \(\vec{a}-\vec{a}=\vec{0}\). |
| opposite vector | The vector \(-\vec{a}\) with the same magnitude and exactly the opposite direction. It is the scalar multiple with \(k=-1\), and it is used in the difference \(\vec{a}-\vec{b}=\vec{a}+(-\vec{b})\). |
| scalar multiple | A vector multiplied by a number \(k\) (scalar multiplication). The length becomes \(k\) times as long in the same direction, and if \(k\) is negative the direction reverses. |
| parallelogram law | The rule that the sum of two vectors is the diagonal of the parallelogram with those two vectors as sides. It is used directly to combine forces in a diagram. |
| dot product | A calculation that turns two vectors into one number. It is defined as \(|\vec{a}||\vec{b}|\cos\theta\), and in components it is \(a_1b_1+a_2b_2\). It shows as a number how well the two directions line up. |
| angle between two vectors | The angle \(\theta\) formed when two vectors start at the same point. It is taken in the range \(0^{\circ}\) to \(180^{\circ}\). |
| projection | The shadow of one vector cast onto the direction of another by light shining straight down (the orthogonal projection). The length of the projection of \(\vec{b}\) onto the direction of \(\vec{a}\) is \(|\vec{b}|\cos\theta\) (the scalar projection), and the dot product can be read as this shadow length times \(|\vec{a}|\). |
| perpendicular | Two vectors meeting at a right angle (also called orthogonal). For two vectors that are not the zero vector, it is the same as the dot product being 0. |
| parallel | Two vectors pointing in the same direction or exactly opposite directions. It is the same as one being a scalar multiple of the other, and in the plane you can check it from the components alone with \(a_1b_2-a_2b_1=0\). |
| position vector | A vector that starts at the origin and shows the position of a point. The position vector of point A is \(\overrightarrow{\mathrm{OA}}\), and the coordinates of the point are its components. It is the starting point for studying shapes with vectors. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.
| The coordinate plane and 3D coordinates (Grade 6 to Precalculus) |
|
| Arithmetic with negative numbers (Grade 7) |
|
| Square roots (Grade 8 to Algebra 1) |
|
| The Pythagorean theorem (Grade 8) |
|
| Trigonometry - cosine (Geometry) |
|
| Equations and fractions (Grades 6–8) |
|
How to calculate it in Excel
| x component a1 | 4 |
| y component a2 | 2 |
| z component a3 (0 for 2D) | 4 |
| Magnitude |a| | =SQRT(B1^2+B2^2+B3^2) |
| a, x component a1 | 4 |
| a, y component a2 | 2 |
| a, z component a3 | 4 |
| b, x component b1 | -1 |
| b, y component b2 | 2 |
| b, z component b3 | 2 |
| Sum, x component | =B1+B4 |
| Sum, y component | =B2+B5 |
| Sum, z component | =B3+B6 |
| Difference, x component | =B1-B4 |
| Difference, y component | =B2-B5 |
| Difference, z component | =B3-B6 |
| Scalar k | 2 |
| x component a1 | 4 |
| y component a2 | 2 |
| z component a3 | 4 |
| k times, x component | =B1*B2 |
| k times, y component | =B1*B3 |
| k times, z component | =B1*B4 |
| a, x component a1 | 4 |
| a, y component a2 | 2 |
| a, z component a3 | 4 |
| b, x component b1 | -1 |
| b, y component b2 | 2 |
| b, z component b3 | 2 |
| Dot product a·b | =B1*B4+B2*B5+B3*B6 |
| Dot product a·b | 8 |
| Magnitude |a| | 6 |
| Magnitude |b| | 3 |
| cosθ | =B1/(B2*B3) |
| Angle θ (degrees) | =DEGREES(ACOS(B4)) |
| Angle θ (radians) | =ACOS(B4) |
| a, x component a1 | 4 |
| a, y component a2 | 2 |
| b, x component b1 | -1 |
| b, y component b2 | 2 |
| Dot product a·b | =B1*B3+B2*B4 |
| Perpendicular? | =IF(B5=0,"Perpendicular","Not perpendicular") |
| a1b2 − a2b1 | =B1*B4-B2*B3 |
| Parallel? | =IF(B7=0,"Parallel","Not parallel") |
| x component a1 | 4 |
| y component a2 | 2 |
| z component a3 (0 for 2D) | 4 |
| Magnitude |a| | =SQRT(B1^2+B2^2+B3^2) |
| Unit vector, x component | =B1/B4 |
| Unit vector, y component | =B2/B4 |
| Unit vector, z component | =B3/B4 |
| Check - magnitude of the unit vector | =SQRT(B5^2+B6^2+B7^2) |
"^" is a power, SQRT is the square root, ACOS is the inverse cosine (a function that finds the angle from a cosine value), and DEGREES converts radians to degrees.
Tables 1 to 4 use the 3D vectors a = (4, 2, 4) and b = (−1, 2, 2). The magnitude |a| is 6, the sum is (3, 4, 6), the difference is (5, 0, 2), 2a is (8, 4, 8), and the dot product is 8. For 2D vectors, set the z component cells to 0.
Table 5 finds the angle from that dot product of 8 and the magnitudes 6 and 3. cosθ is 0.4444…, and the angle is about 63.61 degrees (about 1.1102 radians).
Table 6 uses the 2D vectors a = (4, 2) and b = (−1, 2). The dot product is 0, so it shows "Perpendicular", and a1b2 − a2b1 is 10, not 0, so it shows "Not parallel".
Table 7 finds the unit vector for the same a = (4, 2, 4) as table 1. Each component is divided by the magnitude 6, giving (0.6667, 0.3333, 0.6667), and the bottom row confirms that its magnitude is exactly 1.
How to calculate it in Google Sheets
| x component a1 | 4 |
| y component a2 | 2 |
| z component a3 (0 for 2D) | 4 |
| Magnitude |a| | =SQRT(B1^2+B2^2+B3^2) |
| a, x component a1 | 4 |
| a, y component a2 | 2 |
| a, z component a3 | 4 |
| b, x component b1 | -1 |
| b, y component b2 | 2 |
| b, z component b3 | 2 |
| Sum, x component | =B1+B4 |
| Sum, y component | =B2+B5 |
| Sum, z component | =B3+B6 |
| Difference, x component | =B1-B4 |
| Difference, y component | =B2-B5 |
| Difference, z component | =B3-B6 |
| Scalar k | 2 |
| x component a1 | 4 |
| y component a2 | 2 |
| z component a3 | 4 |
| k times, x component | =B1*B2 |
| k times, y component | =B1*B3 |
| k times, z component | =B1*B4 |
| a, x component a1 | 4 |
| a, y component a2 | 2 |
| a, z component a3 | 4 |
| b, x component b1 | -1 |
| b, y component b2 | 2 |
| b, z component b3 | 2 |
| Dot product a·b | =B1*B4+B2*B5+B3*B6 |
| Dot product a·b | 8 |
| Magnitude |a| | 6 |
| Magnitude |b| | 3 |
| cosθ | =B1/(B2*B3) |
| Angle θ (degrees) | =DEGREES(ACOS(B4)) |
| Angle θ (radians) | =ACOS(B4) |
| a, x component a1 | 4 |
| a, y component a2 | 2 |
| b, x component b1 | -1 |
| b, y component b2 | 2 |
| Dot product a·b | =B1*B3+B2*B4 |
| Perpendicular? | =IF(B5=0,"Perpendicular","Not perpendicular") |
| a1b2 − a2b1 | =B1*B4-B2*B3 |
| Parallel? | =IF(B7=0,"Parallel","Not parallel") |
| x component a1 | 4 |
| y component a2 | 2 |
| z component a3 (0 for 2D) | 4 |
| Magnitude |a| | =SQRT(B1^2+B2^2+B3^2) |
| Unit vector, x component | =B1/B4 |
| Unit vector, y component | =B2/B4 |
| Unit vector, z component | =B3/B4 |
| Check - magnitude of the unit vector | =SQRT(B5^2+B6^2+B7^2) |
Google Sheets also has a function called SUMPRODUCT. Give it the two ranges of components, as in "=SUMPRODUCT(B1:B3,B4:B6)", and it finds the dot product in a single formula.
How to calculate it in Python
import math
from fractions import Fraction
# Vector components (a fraction such as 3/4 can be written Fraction(3, 4); for 2D, use two items)
a = [Fraction(4), Fraction(2), Fraction(4)]
b = [Fraction(-1), Fraction(2), Fraction(2)]
k, l = Fraction(2), Fraction(3)
# Sum, difference and linear combination (component by component)
vector_sum = [x + y for x, y in zip(a, b)]
vector_diff = [x - y for x, y in zip(a, b)]
combination = [k * x + l * y for x, y in zip(a, b)]
# Dot product, magnitudes and angle
dot = sum(x * y for x, y in zip(a, b))
size_a = math.sqrt(sum(x * x for x in a))
size_b = math.sqrt(sum(x * x for x in b))
cos_theta = dot / (size_a * size_b)
theta_degrees = math.degrees(math.acos(cos_theta))
print(f"Sum: {vector_sum}")
print(f"Difference: {vector_diff}")
print(f"ka + lb: {combination}")
print(f"Dot product: {dot}")
print(f"Magnitude |a|: {size_a}, |b|: {size_b}")
print(f"cos(theta): {float(cos_theta)}, angle: {theta_degrees} degrees")
# Unit vector and perpendicular check
unit_a = [float(x) / size_a for x in a]
print(f"Unit vector in the direction of a: {unit_a}")
print("Perpendicular" if dot == 0 else "Not perpendicular")
How to write it in LaTeX and other math languages (copy and paste)
|a| = √(a₁² + a₂²)
\left|\vec{a}\right| = \sqrt{a_1^{2} + a_2^{2}}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mrow><mo>|</mo><mover><mi>a</mi><mo>→</mo></mover><mo>|</mo></mrow>
<mo>=</mo>
<msqrt>
<mrow>
<msup><msub><mi>a</mi><mn>1</mn></msub><mn>2</mn></msup>
<mo>+</mo>
<msup><msub><mi>a</mi><mn>2</mn></msub><mn>2</mn></msup>
</mrow>
</msqrt>
</mrow>
</math>
abs(vec a) = sqrt(a_1^2 + a_2^2)
Norm[{a1, a2}]
LinearAlgebra:-Norm(Vector([a1, a2]), 2);
norm([a1 a2])
|a| = √(a_1^2 + a_2^2)
a + b = (a₁ + b₁, a₂ + b₂)
\vec{a} + \vec{b} = (a_1 + b_1,\ a_2 + b_2)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>+</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>=</mo>
<mo>(</mo>
<msub><mi>a</mi><mn>1</mn></msub><mo>+</mo><msub><mi>b</mi><mn>1</mn></msub>
<mo>,</mo>
<msub><mi>a</mi><mn>2</mn></msub><mo>+</mo><msub><mi>b</mi><mn>2</mn></msub>
<mo>)</mo>
</mrow>
</math>
vec a + vec b = (a_1 + b_1, a_2 + b_2)
{a1, a2} + {b1, b2}
Vector([a1, a2]) + Vector([b1, b2]);
[a1 a2] + [b1 b2]
a + b = (a_1 + b_1, a_2 + b_2)
ka = (ka₁, ka₂)
k\vec{a} = (k a_1,\ k a_2)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>k</mi><mover><mi>a</mi><mo>→</mo></mover>
<mo>=</mo>
<mo>(</mo>
<mi>k</mi><msub><mi>a</mi><mn>1</mn></msub>
<mo>,</mo>
<mi>k</mi><msub><mi>a</mi><mn>2</mn></msub>
<mo>)</mo>
</mrow>
</math>
k vec a = (k a_1, k a_2)
k {a1, a2}
k * Vector([a1, a2]);
k * [a1 a2]
ka = (k a_1, k a_2)
a ⋅ b = |a||b|cosθ = a₁b₁ + a₂b₂
\vec{a}\cdot\vec{b} = \left|\vec{a}\right|\left|\vec{b}\right|\cos\theta = a_1 b_1 + a_2 b_2
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>⋅</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>=</mo>
<msub><mi>a</mi><mn>1</mn></msub><msub><mi>b</mi><mn>1</mn></msub>
<mo>+</mo>
<msub><mi>a</mi><mn>2</mn></msub><msub><mi>b</mi><mn>2</mn></msub>
</mrow>
</math>
vec a * vec b = abs(vec a) abs(vec b) cos theta = a_1 b_1 + a_2 b_2
Dot[{a1, a2}, {b1, b2}]
DotProduct(Vector([a1, a2]), Vector([b1, b2]));
dot([a1 a2], [b1 b2])
a ⋅ b = |a||b| cos θ = a_1 b_1 + a_2 b_2
cos θ = (a ⋅ b) / (|a||b|)
\cos\theta = \frac{\vec{a}\cdot\vec{b}}{\left|\vec{a}\right|\left|\vec{b}\right|}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>cos</mi><mi>θ</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>⋅</mo>
<mover><mi>b</mi><mo>→</mo></mover>
</mrow>
<mrow>
<mo>|</mo><mover><mi>a</mi><mo>→</mo></mover><mo>|</mo>
<mo>|</mo><mover><mi>b</mi><mo>→</mo></mover><mo>|</mo>
</mrow>
</mfrac>
</mrow>
</math>
cos theta = (vec a * vec b) / (abs(vec a) abs(vec b))
ArcCos[Dot[a, b]/(Norm[a] Norm[b])]
VectorAngle(Vector([a1, a2]), Vector([b1, b2]));
acos(dot(a, b) / (norm(a) * norm(b)))
cos θ = (a ⋅ b)/(|a||b|)
a⊥b ⟺ a ⋅ b = 0, a∥b ⟺ b = ka
\vec{a}\perp\vec{b} \iff \vec{a}\cdot\vec{b}=0,\qquad \vec{a}\parallel\vec{b} \iff \vec{b}=k\vec{a}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>⊥</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>⟺</mo>
<mover><mi>a</mi><mo>→</mo></mover>
<mo>⋅</mo>
<mover><mi>b</mi><mo>→</mo></mover>
<mo>=</mo>
<mn>0</mn>
</mrow>
</math>
vec a _|_ vec b <=> vec a * vec b = 0
Dot[a, b] == 0
evalb(DotProduct(a, b) = 0);
dot(a, b) == 0
a ⊥ b ⟺ a ⋅ b = 0
a / |a| = (a₁/|a|, a₂/|a|)
\frac{\vec{a}}{\left|\vec{a}\right|} = \left(\frac{a_1}{\left|\vec{a}\right|},\ \frac{a_2}{\left|\vec{a}\right|}\right)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mfrac>
<mover><mi>a</mi><mo>→</mo></mover>
<mrow><mo>|</mo><mover><mi>a</mi><mo>→</mo></mover><mo>|</mo></mrow>
</mfrac>
<mo>=</mo>
<mo>(</mo>
<mfrac>
<msub><mi>a</mi><mn>1</mn></msub>
<mrow><mo>|</mo><mover><mi>a</mi><mo>→</mo></mover><mo>|</mo></mrow>
</mfrac>
<mo>,</mo>
<mfrac>
<msub><mi>a</mi><mn>2</mn></msub>
<mrow><mo>|</mo><mover><mi>a</mi><mo>→</mo></mover><mo>|</mo></mrow>
</mfrac>
<mo>)</mo>
</mrow>
</math>
vec a / abs(vec a) = (a_1/abs(vec a), a_2/abs(vec a))
Normalize[{a1, a2}]
LinearAlgebra:-Normalize(Vector([a1, a2]), 2);
[a1 a2] / norm([a1 a2])
a/|a| = (a_1/|a|, a_2/|a|)
How to have ChatGPT do the calculation
You are an assistant for math calculations (vectors). Do the following calculations by actually running Python code, and base your answer only on the numbers from the output (do not answer from mental math or guesses). For the 3D vectors a = (4, 2, 4) and b = (−1, 2, 2), find each of the following. 1. The components of the sum a + b, the difference a − b, and 2a + 3b 2. The magnitudes |a| and |b| (both as exact values with simplified radicals and as decimals) 3. The dot product a·b 4. The angle θ between them (in both degrees and radians, with the exact value if it is a special angle) 5. The unit vector in the direction of a 6. Whether a and b are perpendicular or parallel, and why In Python, use the fractions and math modules (and sympy if needed), and show the formulas you used and the numbers from the output.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
