Scalar product

A vector has magnitude (how long information technology is) and direction:

vector magnitude and direction

Here are two vectors:

vectors

They nates be increased using the "Dot Product" (also see Cross Product).

Calculating

The Sprinkle Product is written using a central dot:

a · b
This means the Scalar product of a and b

We can calculate the Dot Product of two vectors this mode:

dot product magnitudes and angle

a · b = |a| × |b| × cos(θ)

Where:
|a| is the magnitude (length) of vector a
|b| is the magnitude (distance) of vector b
θ is the angle between a and b

So we multiply the length of a times the length of b, so multiply by the cosine of the angle 'tween a and b

Surgery we can aim it this way:

dot product components

a · b = ax × bx + ay × by

And so we multiply the x's, multiply the y's, then add.

Both methods work!

And the leave is a number (named a "scalar" so we know IT is non a vector).

Deterrent example: Calculate the dot product of vectors a and b:

dot product example

a · b = |a| × |b| × cos(θ)

a · b = 10 × 13 × cos(59.5°)

a · b = 10 × 13 × 0.5075...

a · b = 65.98... = 66 (rodlike)

Beaver State we can calculate IT this way:

a · b = ax × bx + ay × by

a · b = -6 × 5 + 8 × 12

a · b = -30 + 96

a · b = 66

Both methods came up with the selfsame solvent (later rounding)

Also note that we used minus 6 for ax (information technology is heading in the disconfirming x-direction)

Note: you fanny use the Transmitter Calculator to help you.

Why cos(θ) ?

OK, to multiply two vectors it makes sense to breed their lengths jointly just only when they point in the same direction .

So we make one "point in the same direction" as the other by multiplying by cos(θ):

THEN we reproduce !

It works exactly the same if we "projected" b alongside a and so multiplied:

Because IT doesn't subject which order we do the multiplication:

|a| × |b| × cos(θ) = |a| × romaine lettuce(θ) × |b|

dot product |b| cos(theta)

Justly Angles

When two vectors are at right angles to each other the scalar product is zero.

Example: work out the Scalar product for:

dot product right angle

a · b = |a| × |b| × cos(θ)

a · b = |a| × |b| × cos(90°)

a · b = |a| × |b| × 0

a · b = 0

or we can figure IT this way:

a · b = ax × bx + ay × by

a · b = -12 × 12 + 16 × 9

a · b = -144 + 144

a · b = 0

This can be a handy way to find out if two vectors are at right angles.

Three or Sir Thomas More Dimensions

This all works fine in 3 (or many) dimensions, besides.

And can really exist very useful!

Example: Surface-to-air missile has measured the end-points of 2 poles, and wants to know the angle betwixt them:

dot product 3d

We have 3 dimensions, so don't forget the z-components:

a · b = ax × bx + ay × by + az × bz

a · b = 9 × 4 + 2 × 8 + 7 × 10

a · b = 36 + 16 + 70

a · b = 122

Now for the other formula:

a · b = |a| × |b| × cos(θ)

But what is |a| ? It is the magnitude, or length, of the vector a. We put up use of goods and services Pythagoras:

  • |a| = √(42 + 82 + 102)
  • |a| = √(16 + 64 + 100)
  • |a| = √180

Likewise for |b|:

  • |b| = √(92 + 22 + 72)
  • |b| = √(81 + 4 + 49)
  • |b| = √134

And we hump from the calculation to a higher place that a · b = 122, then:

a · b = |a| × |b| × cos(θ)

122 = √180 × √134 × romaine(θ)

romaine(θ) = 122 / (√180 × √134)

cos(θ) = 0.7855...

θ = cos lettuce-1(0.7855...) = 38.2...°

Finished!

I tried a computation like that erst, but worked all in angles and distances ... IT was identical hard, involved lots of trigonometry, and my brain pain. The method preceding is much easier.

Hybridize Product

The Dot Production gives a magnitude relation (indifferent number) answer, and is sometimes called the scalar product.

But there is also the Cross Product which gives a vector as an answer, and is sometimes titled the cross product.