Spacer Search | Contact Us

Academics

 

TWO PORTABLE π ALGORITHMS FOR USE IN TECHNICAL CALCULATIONS
USP Home


Academics | Undergraduate Admission | Graduate Studies | Life @ USP | Research | Athletics | Alumni & Friends | About USP | Contact Us | FAQ | News and Events | Visiting and Directions | Give to USP

 

TWO PORTABLE π ALGORITHMS FOR USE IN TECHNICAL CALCULATIONS

Anthony Cuozzo1 , Dr. Lia Vas1
1 Mathematics, Physics, & Computer Science

Many computational sciences require the use of the constant, π, in technical calculations. Because π is a transcendental number, algorithms are employed to approximate it. More often than not, these algorithms strive to decrease the time required for computation, and in consequence, become less portable. To solve this dilemma, two seemingly straightforward approaches were evaluated. The first approach approximates the area, α, within a circle defined by a given radius, r. This is computed by stepping with a quantity within the interval (0,r) along a line that intersects the diameter of the circle at ±45° or ±135°. Each iteration is used to create a triangle, and the sum of the area of these triangles is ≅ ⅛α. The second approach approximates the area outside of a circle, α°, inscribed within the smallest possible square. This is computed by explicitly differentiating y²=x²+r² with respect to x (using a defined value of r). With one of the two possible differentials, iterations are performed from x=0 to x=±r. Each iteration is then used to find the equation of the line tangential to the curve at that point. Intersections with the square are calculated to form a triangle, and the sum of the area of these triangles is ≅ ¼α°. Herein, α=4r²–α° can be used to calculate the area of the circle. The benefit of using one of these algorithms is that neither are complex nor inefficient. In effect, either can be used within computational projects that demand portability, such as those that use multiple programming languages.

Back to Abstract List

 

 

 
USP Logo