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:).
Printable View
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:).
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 :)
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:D. 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:).
Quote:
Originally posted by Alphanos
(In degrees, not radians).
I believe you've been unduly influenced by your postcount.Quote:
Originally posted by Alphanos
because I'd like to use the result in a calculation to get pi
http://www.vbforums.com/attachment.p...postid=1312752
:p
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.
LOL @ NotLKH:)!
Thanks A$$Bandit:).
Any other ideas:)?
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.)Code:sin x
lim ----- = 1
x -> 0 x
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,
is equal to Arctan(1) = Pi/4 and can be approximated using Simpson's rule.Code:1
1
ยง ------- dx
1 + x^2
0
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.
http://mathworld.wolfram.com/Sine.html
dig and have fun.