Question: Rewrite the code replacing the while loop with a for loop. % Pi Via Polygons % Input the iteration parameters... clc delta = input('Enter the
% Pi Via Polygons % Input the iteration parameters... clc delta = input('Enter the error tolerance:'); nMax = input('Enter the iteration bound:'); % The triangle case... n = 3; % Number of Polygon Edges A_n = (n/2)*sin(2*pi); % Inscribed Area B_n = n*tan(pi); % Circumscribed Area ErrorBound = B_n - A_n; % The error bound % Iterate while error too big and n sufficiently small... while (ErrorBound > delta && n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
