Determine the side length of a regular heptagon having the largest area which can fit inside a square with side length 1.
(In reply to
Some thoughts by Kenny M)
This program evaluates the horizontal and vertical spaces occupied by the horizontal and nearly vertical chords as they are rotated varied degrees, relative to the side length of the heptagon:
clearvars,clc
centAngle=360/7;
intAngle=180-centAngle;
%calc chord rel to hept side
liftAngle=180-intAngle;
chord=cosd(liftAngle)*2+1;
%calc diam rel to hept side
hTri=(1/2)/tand(centAngle/2);
radius=(1/2)/sind(centAngle/2);
diam=hTri+radius;
ret=atand((1/2)/diam);
for tilt=1:20
fprintf('%11.8f %15.13f %15.13f \n',tilt,chord*cosd(tilt-ret), chord*cosd(tilt) )
end
syms tilt
eq=chord*cosd(tilt-ret)==chord*cosd(tilt);
t=solve(eq,tilt);
t
eval(t)
eval(chord*cosd(t-ret))
Its output:
1.00000000 2.1990356914262 2.2466373778403
2.00000000 2.2067584015108 2.2456108044542
3.00000000 2.2138089116089 2.2439001962634
4.00000000 2.2201850740670 2.2415060743356
5.00000000 2.2258849466440 2.2384291679436
6.00000000 2.2309067931037 2.2346704143429
7.00000000 2.2352490837429 2.2302309584863
8.00000000 2.2389104958579 2.2251121526750
9.00000000 2.2418899141470 2.2193155561468
10.00000000 2.2441864310506 2.2128429346013
11.00000000 2.2457993470273 2.2056962596615
12.00000000 2.2467281707675 2.1978777082740
13.00000000 2.2469726193422 2.1893896620453
14.00000000 2.2465326182902 2.1802347065164
15.00000000 2.2454083016400 2.1704156303755
16.00000000 2.2436000118694 2.1599354246083
17.00000000 2.2411082998009 2.1487972815870
18.00000000 2.2379339244342 2.1370045940978
19.00000000 2.2340778527148 2.1245609543077
20.00000000 2.2295412592394 2.1114701526697
t =
45/7
ans =
6.42857142857143
ans =
2.23285106759513
shows that the optimal tilt is 45/7 of a degree (approx. 6.42857142857143°), at which time the horizontal and verticals are each 2.23285106759513 of the length of a side of the heptagon. Thus the side of the heptagon must be 1/2.23285106759513 or 0.447857904413231 units.
|
Posted by Charlie
on 2023-03-08 10:36:37 |