|
-
Mar 17th, 2006, 09:24 AM
#1
Thread Starter
New Member
Trigonometric values to 30 DP?
I need to calculate cos of very small angles (~10^-10 radians) very accurately (30 decimal places).
I obviously need some way to implement the trigonometric expansion of cos to many decimal places. How can this be done using a computer algorithm if the computer is only accurate to 7 significant figures?
I suppose it's like working out pi to millions of digits.
-
Mar 17th, 2006, 03:54 PM
#2
Fanatic Member
Re: Trigonometric values to 30 DP?
Welcome to the forums!
One way is to have numbers represented by strings and write special routines. The Foxes group (Italy) has an incredible Excel add-in called Xnumbers that performs variable precision calculations up to 200 digits. Their documentation is outstanding. They recently added a DLL version that allows you to call the routines from VB/VBA. Best part - freeware!
http://digilander.libero.it/foxes/SoftwareDownload.htm
Last edited by VBAhack; Mar 17th, 2006 at 03:57 PM.
-
Mar 18th, 2006, 05:49 AM
#3
Thread Starter
New Member
Re: Trigonometric values to 30 DP?
Thanks VBA, I'll take a look.
-
Mar 18th, 2006, 11:51 AM
#4
Fanatic Member
Re: Trigonometric values to 30 DP?
Here's an example using the DLL:
VB Code:
Sub TestXnumbers()
Dim x1 As Xnumbers, x As Double
Set x1 = New Xnumbers
x = 0.0000000001
Debug.Print Cos(x)
Debug.Print x1.xCos(x, 30)
Debug.Print x1.xCos(x, 45)
Debug.Print x1.xCos(x, 55)
Debug.Print x1.xCos(x, 65)
'1
'0.999999999999999999995
'0.999999999999999999995000000000000000000004166
'0.9999999999999999999950000000000000000000041666666666666
'0.99999999999999999999500000000000000000000416666666666666666666527
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|