Results 1 to 9 of 9

Thread: Calculating SINs of very small numbers?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270

    Question Calculating SINs of very small numbers?

    Is there a way to calculate the sin of an extremely tiny value? (In degrees, not radians). I mean really small, on the order of about 4 *10^-1000000000. This would be extremely helpful. Thanks.
    Alphanos

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    The slope of the sine curve at (0,0) is about 1, for radians. This means that the sine of a very small number is approximately the number itself. The difference can be neglected, depending on the degree of precision you want.
    For degree values you need to divide the number by pi / 180 first, of course

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270
    I'm kind of hoping for a way to calculate it to any desired accuracy, and without using pi, because I'd like to use the result in a calculation to get pi. I'm not sure if this is possible or not, so I came here since I know there are people here who will be able to tell me.
    Alphanos

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: Calculating SINs of very small numbers?

    Originally posted by Alphanos
    (In degrees, not radians).
    Originally posted by Alphanos
    because I'd like to use the result in a calculation to get pi
    I believe you've been unduly influenced by your postcount.

    Attached Images Attached Images  

  5. #5
    Addicted Member
    Join Date
    Aug 2002
    Location
    London UK
    Posts
    255
    You could use the taylor expansion of the sine function:

    sin x = x - x3/3! + x5/5! - x7/7! + ...

    Thing is it's for radians, so you would need to multiply whatever answer you get from using as many terms as the accuracy wants, by pi/180 like the other guy said.
    Not at all related to sheep...

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270
    LOL @ NotLKH!

    Thanks A$$Bandit.

    Any other ideas?
    Alphanos

  7. #7
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Code:
            sin x
    lim     ----- = 1
    x -> 0    x
    For really small numbers, the best approximation is sin x = x. The smaller you get, the more accurate the approximation is. (It is, of course, most accurate for x = 0.)

    This isn't a very common way to calculate Pi.
    A common way is to calculate Arctan(1) - the result is Pi/4.
    Two ways I can currently think of to calculate this:

    1) The series: 1/1 - 1/3 + 1/5 - 1/7 + 1/9...
    2) The integral,
    Code:
    1
         1
    § ------- dx
      1 + x^2
    0
    is equal to Arctan(1) = Pi/4 and can be approximated using Simpson's rule.

  8. #8
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Almost forgot: Assuming you use VB (which is a bad assumption) you can use 4 * Atn(1) to get VB's approximation.
    In ANSI C, you can use atan() which is in math.h.
    In Intel's FPU there is an instruction, FLDPI (Opcode: D9 EB), which pushes the FPU's definition of Pi into the floating point stack.

  9. #9
    Fanatic Member siyan's Avatar
    Join Date
    Jul 2001
    Location
    GOOOAAAAALLLLL!!!!!
    Posts
    869
    Unite, proletariat!

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