Why is it necessary to use sin or cos to determine heading? (dead reckoning)

617 Views Asked by At

Here's the problem:

(see pic for problem): https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-ash3/21281_10152793202590262_1804321932_n.jpg

You have a robot that is moving forward at a variable rate delta distance and you need to work out dead reckoning i.e. how far you're moving to the left or the right (slide).

What I don't understand is what makes sin appropriate for y and not x and vica versa. I wanted to ask for a simple example or explanation to explain what is going on here.

1

There are 1 best solutions below

4
On BEST ANSWER

It just depends on how you're defining your axes and your heading.

If you go with the standard definitions, i.e., the $x$-axis is horizontal, the $y$-axis is vertical, and heading is measured as "the counter-clockwise angle from the positive $x$-axis", then $\Delta D \cdot \cos{\theta} = \Delta x$ and $\Delta D \cdot \sin{\theta} = \Delta y$. That relies on the unit circle definition of sin and cos, which use the same conventions.

Using other conventions will throw in opposite signs, or switch sin and cos. For example, defining heading as "clockwise angle from the positive $y$-axis (like North)" means you switch sin and cos.

EDIT: Diagram! In each of these, I used SOH-CAH-TOA to find $x$ and $y$. In the third, I had to convert from an obtuse angle to an acute one, and to do so, I used its supplementary angle ($180^\circ - \theta$), and some trig identities. Notice that the first and second ones have the same form, even though all the definitions are different.

I would advise sticking to the first form, because it is standard in most of geometry and (in theory) programming. The third might be useful for screen coordinates, and the fourth might be good for systems which use deviation from north as their heading. You could also just convert those $x$s, $y$s, and $\theta$s into a form suitable for the first system though. enter image description here