PDA

Click to See Complete Forum and Search --> : Tan, cos, sin


KingArthur
Oct 28th, 2003, 01:12 PM
Good day(evening?) everybody

I have two questions and I ain't sure which is more important right now:

1. this one is for school:
if all this is true:

tan(a)=-3/4
(90<a<180)
tan(b)=5/12
(0<b<90)

without using a calculator(meaning you musn't find out how much a and b are) what is the value of this expressions:

A. tan(a+b) , tan(a-b)
B. sin(a+b) , sin(a-b)
C. cos(a+b) , cos(a-b)


2. this one is for myself:
as we all know calculators know exactly how much cos(a) is. since the only value we input is a how the hell does it calculate cos(a)???????????????

Guv
Oct 28th, 2003, 07:37 PM
For angles in ranges 0-90 and 180-270, the tangent is positive.
For angles in ranges 90-180 and 270-360, the tangent is negative.

There are formulae for the trig functions of angle sums and differences. I think the following are correct, but I would not bet large sums of money on my memory.

sin(a + b) = sin(a)*cos(b) + cos(a)*sin(b)
cos(a + b) = cos(a)*cos(b) - sin(a)*sin(b)

The difference formulae are similar with some signs changed.

I do not remember the formulae for tan(a + b)

For x in radians (degrees*Pi/180) cosine can be calculated using a converging series.

cos(x) = 1 - x2/2! + x4/4! - x6/6! + x8/8!. . . .

Hu Flung Dung
Oct 28th, 2003, 08:13 PM
Originally posted by Guv

I do not remember the formulae for tan(a + b)



tan(a+b) = [ tan(a) + tan(b) ] / [ 1 - tan(a)tan(b) ]

KingArthur
Oct 28th, 2003, 11:18 PM
thanks ppl but I already know this formulas... they are working very well if I have cos(x) or sin(x) and need to find the others but in this question I got no answer from them(2 houres of tearing papers after they get full:eek: )

as for this one:
cos(x) = 1 - x2/2! + x4/4! - x6/6! + x8/8!. . . .

I have no idea how to use it(plz note that I'm still in the 11th class)

sql_lall
Oct 29th, 2003, 03:24 AM
hey, if u have the additional formulae (i.e. cos(a+b)) to find the subtraction formulae, just change b to -b, and use:
cos(-b) = cos(b), sin(-b) = -sin(b), and tan(-b) = - tan(b)

e.g. sin(a-b) = sin(a + (-b))
= sin(a)cos(-b) + sin(-b) cos(a)
= sin(a)cos(b) - sin(b)cos(a)

etc...

Guv
Oct 29th, 2003, 04:04 PM
You usually need a calculator to evaluate a convergent series. It takes too long using pencil, paper, and brain. The series for sin & cos are as follows.

sin(x) = x - x3/3! + x5/5! - x7/7! . . . .
cos(x) = 1 - x2/2! + x4/4! - x6/6! . . . . where ! indicates the factorial function.

6! = 6*5*4*3*2*1
5! = 5*4*3*2*1
. . .
x must be in radians, and you must use as many terms as required for a given precision. Another interesting and useful series is the following.

ex = 1 + x/1! + x2/2! + x3/3! + x4/4! + x5/5! . . . .

Nowadays it might not be important due to the speed of a modern CPU, but there was a time when run time was important. For x < 1 the above converge much faster than for x > 1

Programmers often use various techniques to avoid extra computations.They would use cos(Angle) = sin(90 - angle) and other trig formulae.

For the exponential series, they would divide x by two enough times to get a value less than one. After computing the exponential for the new value, they would multiply the result by itself enough times to get the correct value. If x is negative, the series converges faster so that they might compute e-x. Note the following.

e3 = ( e3/4 )4

ex = 1/e-xSuppose you wanted cos(60 degrees), which is known to be .5 (we assume you do not know the answer). Knowing by inspection or programming a test, you determine that 60 > 45 and use the sin series to compute sin(30) = cos(60).

First convert to radians: x = .523 598 776, which is 30*Pi/180

sin(x) = .499 674 179, using the first two terms of the sin series.

sin(x) = .500 002 133, using the first three terms.

Do you get the idea? Note the precision if you use cos(60)

x = 1.047 197 551 (60*Pi/180)

cos(x) = .451 688 644, using two terms of the cos series.

cos(x) = .501 796 202, using three terms

cos(x) = .499 964 565, using four terms

cos(x) = .500 000 433, using five terms.

BTW: It is best to evaluate a polynomial without explicitly computing each term and adding them up. The following tends to require less calculations and provide more precision.

cos(x) = [ ( -x2/6! + 1/4! )*x2 - 1/2! ]*x2 + 1

ex = {[( x/4! + 1/3! )x + 1/2! ]x + 1/1! }x + 1

When writing a program to evaluate a polynomial, the precalculated coefficients are stored in an array and a loop is used to evaluate the polynomial.

I hope there are no typo's or computational errors in the above.