Loss of information in tangents

  • Thread starter Thread starter Maxwellkid
  • Start date Start date
  • Tags Tags
    Information Loss
Maxwellkid
Messages
69
Reaction score
0
why is there a lack of accuracy in this subsitution?

\frac{sin\phi}{cos\phi} = tan\phi
 
Mathematics news on Phys.org
Where is the inaccuracy?
 
Please explain your question more.
\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?
 
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.
 
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.
 
Maxwellkid said:
why is there a lack of accuracy in this subsitution?

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.
 
Tac-Tics said:
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.

thank you...
 

Similar threads

Replies
11
Views
2K
Replies
2
Views
1K
Replies
2
Views
2K
Replies
1
Views
1K
Replies
2
Views
2K
Replies
7
Views
1K
Replies
1
Views
3K
Replies
5
Views
1K
Back
Top