Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 pi
Index -> Programming, Turing -> Turing Submissions
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Sun Oct 29, 2006 10:17 am   Post subject: (No subject)

Andy wrote:
to find pi, just do an taylor expansion of tan(x). there are faster ways of approximating pi than that gandalf =P


I did that a while back, and I got 15 decimal places of accuracy just from Microsoft's calc.exe. I think 15 was the number of decimal places it displayed.

My question is, is this approach really valid? tan x = sinx / cosx. sinx and cosx come from circles, right? So aren't we using a bit of circular (oh, oh, pun!) reasoning here?

I know sinx and cosx can be approximated by a Taylor series, but my question still remains.
Sponsor
Sponsor
Sponsor
sponsor
Windsurfer




PostPosted: Mon Oct 30, 2006 7:06 pm   Post subject: (No subject)

Andy wrote:
to find pi, just do an taylor expansion of tan(x). there are faster ways of approximating pi than that gandalf =P

Ha. I've experienced that. On my Ti-83 Plus, I had a basic program that would use that one Gandolf said, and it would take forever to find the first 5 digits. I think it was like 500 iterations? Can't remember.
But then I implemented the taylor expansion method (or something similar) and my calc ran out of digits on the 12th or 14th iteration, so less than 2 seconds Razz
Andy




PostPosted: Mon Oct 30, 2006 9:23 pm   Post subject: (No subject)

but cervantes, you're not using sin(x) and cos(x) to calculate values.

tan(x) = sin(x)/cos(x)

and sin(x) can be expanded into sin(x) = x - x3/3! + x5/5! - x7/7! + ...
and cos(x) into cos(x) = cos(x) = 1 - x2/2! + x4/4! - x6/6! + ...

then you just need to do a long division

so you're not cheating at all =P
Cervantes




PostPosted: Tue Oct 31, 2006 12:37 am   Post subject: (No subject)

How did we get those series for sin(x) and cos(x)?

I think I detect sarcasm in your last sentence there, right? So this method is using circular reasoning, yes? Or does it matter? Since we don't necessarily need a value for pi to find values for sin(x). Or do we?
Andy




PostPosted: Tue Oct 31, 2006 1:28 am   Post subject: (No subject)

you use taylor's theorum to get those series.

you dont actually need to know the value of pi to determine what sin(pi) and cos(pi) is.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 20 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: