An octagon which has side lengths 3, 3, 11, 11, 15, 15, 15 and 15 is inscribed
in a circle. Find the area of the octagon.
The program tries different radii for the circumscribing circle to home in on where the calculated isoscelese triangles (formed from adjacent right triangles) have their apex angles total 360°.
clearvars,clc
side=[ 3, 3, 11, 11, 15, 15, 15,15];
for r= 14.577379737113:.00000000000001:14.577379737114
totArea=0; totAngle=0;
for i=1:length(side)
angle=asind(side(i)/(2*r));
totArea=totArea+side(i)*cosd(angle);
totAngle=totAngle+2*angle;
end
fprintf('%15.13f %15.13f %15.13f\n',r,totArea,totAngle);
end
is the final version narrowing in on the following inclueded output:
Radius of circle Area of Octagon Verification of
total central angle
14.5773797371132 77.7917582206420 360.0000000000003
14.5773797371133 77.7917582206420 360.0000000000001
14.5773797371133 77.7917582206420 359.9999999999998
14.5773797371133 77.7917582206420 359.9999999999994
the desired area is 77.7917582206420.

Posted by Charlie
on 20240611 12:44:37 