There are many methods to get the pi(Ratio of circumference to diameter). You should get pi without using the pi function in MATLAB.
https://en.wikipedia.org/wiki/Pi The Chinese mathematician Zu Chongzhi, around 480 AD, calculated that π ≈ 355/113. With a correct value for its seven first decimal digits, this value of 3. 141592920 , remained the most accurate approximation of π available for the next 800 years.