Finding x and y coordinates from the angle

1.7k Views Asked by At

I have a robot that I am trying to program. I came up with a way to find by how many degrees my arm moved but I want to find a relative $(x , y)$ coordinates. I think that I found the formula:

$x = D_1 * \cos(D_1\theta)$ and $y = D_1 * \sin(D_1\theta)$.

$D_1$ is the length of my robot arm. $D_1\theta$ is the degree that it moved in radians. Why is it $\cos$ and $\sin$, I don’t get it.

1

There are 1 best solutions below

3
On BEST ANSWER

Just try to visualize it on a circle with radius $r$. (Like a unit circle except the radius can be anything.)

For an angle $\theta$ drawn from the origin, you form a right-triangle with hypotenuse $r$. The horizontal leg (call it $x$) is adjacent to angle $\theta$ while the vertical leg (call it $y$) is opposite to angle $\theta$. Thus, you can conlude

$$\cos \theta = \frac{x}{r} \implies x = r\cos \theta$$

$$\sin \theta = \frac{y}{r} \implies y = r\sin \theta$$