In homework 3.4, you're asked to simulate circular robotic motion. We gave you some equations to help you along in your simulations. I want to give you those formulas again and explain where some of them came from. The first equation I want to talk about is this one. The radius of curvature is equal to the length of the vehicle over the tangent of alpha where alpha is our steering angle. Let me write that up here. So where does this equation come from. To derive it, the key realization is that the front and rear tire do not travel along the same circle. Here's my rear tire, and here's my front tire. They are, of course, separated by a distance that we called "L." Let's draw the circles that these tires travel along. Well, this rear tire is actually going to travel along a smaller inner circle while this tire is going to travel along a larger outer circle. Since we defined our radius of curvature as the distance from the back tire to the center, Let's label this r, and we can see that the line connecting these tires defines an axis, and here we have our steering angle, alpha, from here. Now we can do a little bit of geometry. Let's make a right triangle. Well, if this angle here is alpha, then this much be a 90 degree angle, because a radius intersecting with a tangent line always forms a right angle. That means that that this angle here must be equal to 90 degrees minus alpha, which means this angle, since this is a right triangle must be alpha. Well, we're almost there. The tangent of this angle is equal to the opposite side, which is the length, over the adjacent side, which is the radius. So tangent of alpha is equal to L over r. We manipulate this equation a little bit, and we find that the radius of curvature is equal to the length of the vehicle over the tangent of the steering angle.
For homework 3.4, we also give you equations for the position of our robot. Let's start at the center coordinates of our circle, because our robot is undergoing circular motion, and we can look at the (x, y) coordinates of our robot before the motion. Now, the question is given these (x, y) coordinates and the robot's orientation angle theta, how can we find cx and cy. Well, we just define a right triangle, and we see that this angle is theta. We can show this angle must also be theta. This length is R, so that means this horizontal distance is R times the sine of theta, and the vertical distance is R times the cosine of theta. That means that cx is just equal to the initial x position minus this extra distance, R times the sine of theta, and cy is equal to the initial y position plus this extra distance, R times the cosine of theta. Okay. Now let's let our car advance by some turning angle beta. This angle is beta, and here is our robot car. Let's call these coordinates x-prime, y-prime. How can I get an equation for x-prime and y-prime. Well, we can see that this total angle here is equal to beta plus theta, and just as we defined a right triangle before, we can define another right triangle where this line is going to be R times the sine of beta plus theta, and this line will be R times the cosine of beta plus theta. So working from our center point, x-prime is going to be equal to cx plus this extra distance, which is R times the sine of beta plus theta, and the y-prime we can see will be cy minus the extra distance of R times the cosine of beta plus theta. Theta prime, of course, will just be equal to our old theta plus the turning angle. We can't forget to make the mod 2Ï. Good work.