Calculate pi

Calculate decimals of pi with Machin's formula
Updated 16 Apr 2019

View License

MACHIN(M) gives a string with pi truncated to M decimals
using Machin's formula: pi = 16*acot(5) - 4*acot(239)

Cite As

Jonas Lundgren (2024). Calculate pi (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes