Thank you bharani10. That is a nice start.
I am only adding to the math part.
If you want Pi to be more accurate, and if you have learned from the previous post, then you might try including (as you decide) some of this:
From
https://en.wikipedia.org/wiki/Pi
Fractions: Approximate fractions include (in order of increasing accuracy)
22/7,
333/106,
355/113,
52163/16604,
103993/33102,
104348/33215, and
245850922/78256779 .
Please read the linked page from Wikipedia. It explains a lot more of the math.
.