Tag Archives: Pi

Solve Geometric Problems with C#

[This is a promo piece by Packt, the publisher of my book The Modern C# Challenge. It includes two of the 100 example problems and solutions in the book.] Solve Geometric Problems with C# Learn how to solve C# geometric … Continue reading

Posted in books, geometry, mathematics | | Comments Off on Solve Geometric Problems with C#

Use digits of Pi to draw a picture in C#

The article 10 stunning images show the beauty hidden in pi shows several ways to use Pi to generate pictures. This example demonstrates one of them. The program starts drawing at the origin (0, 0). It then scans through the … Continue reading

Posted in algorithms, drawing, graphics, mathematics, strings | | Comments Off on Use digits of Pi to draw a picture in C#

Look for dates in the digits of Pi in C#

The example Find patterns within pi in C# looks for patterns within the digits of Pi. You can use that example to look for dates such as 4/1. This example determines whether the first 100 thousand digits of Pi contains … Continue reading

Posted in algorithms, mathematics, strings | | Comments Off on Look for dates in the digits of Pi in C#

Find patterns within Pi in C#

March 14 is known as Pi Day because its numeric representation 3/14 includes the first three digits of Pi: 3.14. (At least in the United States. In Europe where they usually write dates month first, Pi Day is July 22 … Continue reading

Posted in algorithms, mathematics, strings | | 1 Comment

Graph several pi approximations in C#

This example graphs pi approximations by combining the techniques described in the following two posts: Approximate pi using several different methods in C# Graph pi approximations in C# For each series, the program uses the series to generate approximations for … Continue reading

Posted in algorithms, geometry, graphics, mathematics | | Comments Off on Graph several pi approximations in C#

Approximate pi using several different methods in C#

The post In honor of Pi Day (3.14), approximate pi in C# uses the following sequence to approximate pi. That sequence is elegant but unfortunately it converges very slowly so you need to take a lot of terms to get … Continue reading

Posted in algorithms, mathematics | | 1 Comment

Graph pi approximations in C#

My post In honor of Pi Day (3.14), approximate pi in C# uses the following series to approximate the value π. As you add terms to the series, the approximation alternates between values that are above and below the true … Continue reading

Posted in algorithms, geometry, graphics, mathematics | | 1 Comment

In honor of Pi Day (3.14), approximate pi in C#

There are several ways to calculate π. Many use an infinite series such as the following one. This isn’t necessarily the best series to use, but it is relatively simple. When the program starts, it uses the following code to … Continue reading

Posted in algorithms, mathematics | | 1 Comment