# Loss of information in tangents

1. Aug 19, 2009

### Maxwellkid

why is there a lack of accuracy in this subsitution?

$$\frac{sin\phi}{cos\phi} = tan\phi$$

2. Aug 19, 2009

### Gear300

Where is the inaccuracy?

3. Aug 20, 2009

### HallsofIvy

$$\frac{sin(\phi)}{cos(\phi)}= tan(\phi)$$
is exactly true for every $\phi$ for which either side is defined. What makes you think there is an "inaccuracy" and what do you mean by that?

4. Aug 20, 2009

### Дьявол

sin(x) = a / h

cos (x) = b / h

sin(x) / cos(x) = a / b, which gave us the definition of tan(x).

What is inaccurate here?

Regards.

5. Aug 21, 2009

### Mentallic

You'll have to elaborate a bit more. Basically, if you're asking this because you were doing something else with the trig functions such as solving equations and found that you didn't quite get all the solutions right etc. then the problem in what you've done lies elsewhere.

e.g. solving for x: $$sin(x)+1=cos(x)$$

This equation has solutions $$x=0,\frac{3\pi}{2},2\pi$$ for $$0 \leq x \leq 2\pi$$

but if you were to divide through by $$cos(x)$$ to obtain the equation:

$$tan(x)+sec(x)=1$$ you've just lost the solutions where $$cos(x)=0$$

So for $$0 \leq x \leq 2\pi$$ we've lost the solution $$\frac{3\pi}{2}$$

There is no problem in the tangent fuction though.

6. Aug 21, 2009

### Tac-Tics

This reminds me of a problem I had back when I was interested in programming games. Given an object at position (x, y) with a velocity (dx, dy), what is the angle the object is moving at with relation to the x-axis?

What you find out is that arc tangent isn't quite what you need. Because tangent is periodic with a period of pi, the arc tangent function won't distinguish between the correct direction and the direction exactly opposite it.

Because of this, most computer languages implement a function called atan2. By taking dx and dy as two separate parameters (as opposed to taking their ration, dy/dx as the parameter), atan2 can distinguish between the two cases and can provide you the correct angle of motion for your object.

7. Aug 22, 2009

thank you...