Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleCalculate Pi using several series
Keywordspi, calculate, series, Euler, Gregory's Formula, Gregory's Series, Machin's Formula
CategoriesAlgorithms
 
This example shows how to calculate Pi using the following formulas:

  • Pi = 4 * Atn(1)

  • Gregory's Formula (slow)
    Pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...

  • Gregory's Series
    Pi/2/Sqrt(3) = 1 - 1/3/3 + 1/5/3^2 - 1/7/3^3 + ...

  • Machin's Formula
    Pi/4 = 4*atn(1/5) - atn(1/239)

  • Euler's Formula
    Pi/4 = 4*atn(1/2) + atn(1/3)

See the code for the details.

Also see Pi and the Fibonacci Numbers for lots of interesting discussion.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated