DEV Community

Cover image for Multiplying Vectors by a Scalar
BazengDev
BazengDev

Posted on

Multiplying Vectors by a Scalar

Key Concept:

Multiplying a vector by a scalar means scaling the vector's magnitude by that scalar while keeping its direction (or reversing it if the scalar is negative).
If a is a vector and k is a scalar, the result is

  • a⋅k=[a1.k,a2⋅k], where a1 and a2 are the vector's components.

Example 1: Multiply Vector a=[2,1] by Scalar 3

1. Given vector: a=[2,1]

2. Scalar: k=3

3. Calculation: a3= [2⋅3,1⋅3] = [6,3]

4. Result: [6,3]

example-1

Example 2: Multiply Vector a=[2,1] by Scalar -1

1. Given vector: a=[2,1]

2. Scalar: k=-1

3. Calculation: a-1= [2⋅-1,1⋅-1] = [-2,-1]

4. Result: [-2,-1]

example-2

Observations:

  • When multiplied by 3, the vector's magnitude triples, and the direction remains the same.
  • When multiplied by −1, the vector's magnitude remains the same, but the direction is reversed.

Top comments (0)