Hey everyone, kinda struggling with a part of my hw assignment. would anyone know how I could get started.?? here is the question:
Graphical Determination of Pi: The full value of pi, which no one really knows for sure, can be approximated by considering the area bounded by a quarter circle. For a quarter circle of radius r = 2 meters, the formula for the area of a full circle (4 x pi square meters) implies that the area of a quarter of a circle that is radius of 2 m should be equal to pi square meters (4*pi/4 = pi). That area can be approximated by summing the areas of vertical rectangles of fixed width w and variable height h. Write a C++ program that estimates the value of pi this way. Use this algorithm, which splits the quarter circle into a large number of rectangles of variable heights, such that the midpoint of each rectangle’s roof lies on the arc of the quarter circle. starting at the left side (x=0) and moving to the right, one rectangle at time (until x==r), the height of each rectangle lessens according to h = (r2 –x2)1/2, while the area of each rectangle is just (w x h).