Dot Product & Projections
The dot product (also called scalar product) is one of the most important operations in robotics. It tells us how much two vectors point in the same direction and is essential for computing angles between robot links.
What is the Dot Product?
The dot product of two vectors produces a scalar (single number):
In 2D:
Geometric Interpretation
The dot product also equals:
where is the angle between the vectors.
This formula connects:
- Algebraic definition (multiply components)
- Geometric meaning (angle between vectors)
Interactive Exploration
Adjust the vectors to see how the dot product changes with direction and magnitude:
Vector a (blue)
Vector b (green)
Dot Product Results
Interpretation: The dot product measures how much two vectors point in the same direction. When perpendicular (90°), the dot product is 0. The projection (orange) shows the "shadow" of vector a onto vector b.
Understanding the Result
The sign of the dot product tells us about the angle:
- Positive (): Vectors point in similar directions ()
- Zero (): Vectors are perpendicular ()
- Negative (): Vectors point in opposite directions ()
Key Insight
The dot product measures alignment. Maximum when parallel, zero when perpendicular, negative when opposing.
Robot Arm Joint Angle Robotics Application
A 2-link robot arm has:
- Link 1 pointing at
- Link 2 pointing at (at 45° from link 1)
To find the angle between them:
Computing Angles
We can rearrange the geometric formula to find angles:
This is crucial in robotics for:
- Measuring joint angles
- Checking if the robot is at a desired configuration
- Collision detection
- Path planning
Numerical Stability
When implementing this, ensure stays in to avoid arccos errors. Floating-point math can sometimes give values slightly outside this range!
Vector Projection
The projection of onto is the “shadow” of along ‘s direction:
The projection has magnitude:
Force Analysis on Robot Gripper Robotics Application
A robot gripper exerts force N on an object. The surface normal is .
The force component perpendicular to the surface:
This is the “squeezing” force. The remaining N is the tangential (sliding) force.
Properties of the Dot Product
- Commutative:
- Distributive:
- Scalar multiplication:
- Self dot product:
Robotics Applications
1. Forward Kinematics Verification
Check if computed end-effector position matches expected direction.
2. Sensor Alignment
Determine if a sensor is pointing toward a target:
If close to 1, sensor is well-aligned.
3. Workspace Analysis
Check if a point is within the robot’s reachable workspace by comparing direction vectors.
4. Obstacle Avoidance
Compute the component of velocity toward an obstacle:
If positive, robot is approaching the obstacle.
Mobile Robot Navigation Robotics Application
A robot at moving with velocity m/s detects an obstacle at .
Direction to obstacle:
Unit vector:
Velocity toward obstacle: m/s
The robot is approaching at 1 m/s. Time to collision: seconds.
Key Takeaways
- Dot product measures how aligned two vectors are
- Use it to compute angles:
- Projection gives the component of one vector along another
- Critical for joint angle computation, force analysis, and navigation
- Perpendicular vectors have dot product zero
Practice Problems
-
Calculate for and .
-
Find the angle between and .
-
Two robot links form vectors and . What’s the angle between them?
-
Project onto . What’s the magnitude of the projection?
-
A force N acts on a surface with normal . What’s the perpendicular component?
Coming Up Next
The cross product takes two vectors and produces a third vector perpendicular to both. This is essential for computing torques in robot manipulators!