Module 1: Foundations Lesson 1 of 3

Vectors in Robotics

Vectors are the foundation of robotics mathematics. They allow us to represent positions, velocities, forces, and many other physical quantities that have both magnitude and direction.

What is a Vector?

A vector is a mathematical object that has:

We write vectors in bold (v\mathbf{v}) or with an arrow (v\vec{v}). In 2D, a vector has two components:

v=[vxvy]\vec{v} = \begin{bmatrix} v_x \\ v_y \end{bmatrix}

In 3D, it has three components:

v=[vxvyvz]\vec{v} = \begin{bmatrix} v_x \\ v_y \\ v_z \end{bmatrix}

Notation

We’ll use (x,y)(x, y) or (x,y,z)(x, y, z) notation for simplicity, but remember these represent column vectors in formal mathematics.

Vectors in Robotics

In robotics, vectors are everywhere:

Robot Position Robotics Application

A mobile robot at position (2,3)(2, 3) meters means it’s 2 meters along the x-axis and 3 meters along the y-axis from the origin.

If the robot moves with velocity vector (0.5,0.3)(0.5, 0.3) m/s for 2 seconds, its new position will be:

pnew=pold+vt=(2,3)+(0.5,0.3)2=(3,3.6)\vec{p}_{new} = \vec{p}_{old} + \vec{v} \cdot t = (2, 3) + (0.5, 0.3) \cdot 2 = (3, 3.6)

Vector Addition

When we add two vectors, we combine their effects. This is called the parallelogram rule or tip-to-tail method.

c=a+b=(ax+bx,ay+by)\vec{c} = \vec{a} + \vec{b} = (a_x + b_x, a_y + b_y)

Interactive Exploration

Try adjusting the vectors below to see how vector addition works visually!

Controls

Vector a (blue)

2.000
-55
1.500
-55

Vector b (green)

-1.000
-55
2.000
-55

Results

Vector a: (2.00, 1.50)
Vector b: (-1.00, 2.00)
a + b: (1.00, 3.50)
|a| = 2.500
|b| = 2.236
|a + b| = 3.640

Tip: Vector addition follows the parallelogram rule. The dashed green vector shows how vector b is placed at the tip of vector a. The resultant (red) goes from the origin to the final point.

Properties of Vector Addition

  1. Commutative: a+b=b+a\vec{a} + \vec{b} = \vec{b} + \vec{a}
  2. Associative: (a+b)+c=a+(b+c)(\vec{a} + \vec{b}) + \vec{c} = \vec{a} + (\vec{b} + \vec{c})
  3. Identity: a+0=a\vec{a} + \vec{0} = \vec{a}
  4. Inverse: a+(a)=0\vec{a} + (-\vec{a}) = \vec{0}

Robot Path Planning Robotics Application

A robot needs to move from point A to point C. It can either:

  • Go directly: Follow vector AC\vec{AC}
  • Take a detour: Follow AB\vec{AB} then BC\vec{BC}

By vector addition: AC=AB+BC\vec{AC} = \vec{AB} + \vec{BC}

The direct path and the detour lead to the same final position!

Scalar Multiplication

Multiplying a vector by a scalar (number) scales its magnitude:

kv=(kvx,kvy,kvz)k\vec{v} = (kv_x, kv_y, kv_z)

Robot Speed Control Robotics Application

A robot moving with velocity v=(1,0.5)\vec{v} = (1, 0.5) m/s can:

  • Double its speed: 2v=(2,1)2\vec{v} = (2, 1) m/s
  • Go half as fast: 0.5v=(0.5,0.25)0.5\vec{v} = (0.5, 0.25) m/s
  • Reverse direction: v=(1,0.5)-\vec{v} = (-1, -0.5) m/s

Vector Magnitude

The magnitude (or length) of a vector is calculated using the Pythagorean theorem:

v=vx2+vy2+vz2|\vec{v}| = \sqrt{v_x^2 + v_y^2 + v_z^2}

In 2D: v=vx2+vy2|\vec{v}| = \sqrt{v_x^2 + v_y^2}

Units Matter!

Always keep track of units. If position is in meters, velocity is in meters/second, and magnitude has those same units.

Unit Vectors

A unit vector has magnitude 1. We can create a unit vector by normalizing any non-zero vector:

v^=vv\hat{v} = \frac{\vec{v}}{|\vec{v}|}

Unit vectors are useful for representing pure direction without magnitude.

Robot Heading Direction Robotics Application

A robot moving with velocity (3,4)(3, 4) m/s:

  • Speed (magnitude): 32+42=5\sqrt{3^2 + 4^2} = 5 m/s
  • Direction (unit vector): v^=(3,4)5=(0.6,0.8)\hat{v} = \frac{(3, 4)}{5} = (0.6, 0.8)

The unit vector (0.6,0.8)(0.6, 0.8) tells us the robot’s heading, while the magnitude tells us how fast.

Key Takeaways

Practice Problems

  1. A robot at position (1,2)(1, 2) moves by displacement (3,4)(-3, 4). What’s its new position?

  2. Two forces act on a robot: F1=(10,5)\vec{F}_1 = (10, 5) N and F2=(3,8)\vec{F}_2 = (-3, 8) N. What’s the net force?

  3. A velocity vector is (6,8)(6, 8) m/s. What’s its magnitude? What’s the unit vector?

  4. If a robot moves with constant velocity (2,1)(2, 1) m/s, where will it be after 3 seconds if it starts at the origin?

Ready for More?

Now that you understand vector basics, the next lesson covers the dot product - a way to measure how much two vectors align with each other. This is crucial for computing angles in robot arms!