Safekipedia

Dot product

Adapted from Wikipedia · Discoverer experience

In mathematics, the dot product is an algebraic operation that takes two equal-length sequences of numbers, usually coordinate vectors, and returns a single number. This operation combines two vectors to give a scalar value, which is why it is also called the scalar product.

Algebraically, the dot product is calculated by multiplying together the matching numbers in each sequence and then adding up all those products. Geometrically, the dot product tells us about the relationship between two vectors. It equals the product of the lengths of the two vectors and the cosine of the angle between them.

The dot product is very useful in many areas of math and physics. It helps in finding the angle between vectors and is used to determine how much one vector extends in the direction of another. Because it gives a single number, the dot product is different from the vector product, which results in another vector. The name “dot product” comes from the dot operator “  ” often used to show this operation.

Definition

The dot product is a way to combine two lists of numbers (called vectors) to get a single number. It can be thought of in two ways: algebraically and geometrically.

Algebraically, if you have two vectors, you multiply matching numbers from each vector and then add all those products together. For example, for vectors [1, 3, -5] and [4, -2, -1], the dot product is (1×4) + (3×-2) + (-5×-1) = 4 - 6 + 5 = 3.

Geometrically, the dot product relates to the angle between two vectors. It equals the product of the lengths of the two vectors and the cosine of the angle between them. This means the dot product can tell us how "aligned" two vectors are. If the vectors are at right angles, their dot product is zero. If they point in the same direction, the dot product is positive and large.

Properties

The dot product has several important properties. It is commutative, meaning the order of the vectors does not matter: a · b = b · a. This comes from the angle between the vectors.

It is also bilinear, which includes being additive and distributive with scalars. However, it is not associative, meaning you cannot rearrange parentheses freely.

Two vectors are orthogonal (at right angles) if their dot product equals zero. Unlike regular multiplication, the dot product does not follow the cancellation law.

There is also a product rule for derivatives when dealing with changing vectors over time.

Application to the law of cosines

Main article: Law of cosines

When two vectors form a triangle, the dot product helps find the length of the third side using the law of cosines.

Triple product

Main article: Triple product

There are two important operations that use the dot product and the cross product.

The scalar triple product of three vectors is found by multiplying one vector by the result of the cross product of the other two. It gives the signed volume of a special shape called a parallelepiped formed by the three vectors.

The vector triple product is found by taking the cross product of one vector with the result of the cross product of the other two vectors. This can be rewritten using dot products, which helps simplify problems in physics.

Physics

In physics, the dot product takes two vectors and returns a scalar quantity. It is also known as the "scalar product". The dot product can be calculated by multiplying the sizes of the two vectors and the cosine of the angle between them.

For example:

Generalizations

The dot product, a way to multiply two lists of numbers to get a single number, can be expanded to work with more complex types of numbers and shapes.

When dealing with numbers that include imaginary parts, the dot product changes slightly to ensure useful properties. This adjusted version helps in measuring sizes and angles in more advanced math and physics.

The idea of a dot product also extends to more abstract settings and even to functions, where it involves integrating products of functions over certain ranges.

Computation

The basic way to calculate a dot product of vectors can sometimes cause problems with very small numbers. Special methods, like the Kahan summation algorithm, help avoid these issues.

Many programming tools have built-in functions for calculating dot products, including:

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Dot product, available under CC BY-SA 4.0.