Results 1 to 6 of 6

Thread: Tan, cos, sin

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    152

    Tan, cos, sin

    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)???????????????

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    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!. . . .
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  3. #3
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    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) ]

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    152
    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 )

    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)

  5. #5
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Talking negatives

    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...
    sql_lall

  6. #6
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    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-x
    Suppose 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.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width