The distances from a certain point inside a regular hexagon to three of its consecutive vertices are equal to 1, 1 and 2, respectively. Find the length of this hexagon's side.
If the side is length s:
1 = 1+s^2 - 2*s*cos(a1)
where a1 is the angle at the middle vertex within the smaller formed triangle.
In the larger triangle is angle a2, the other portion of the full 120° angle of the middle of the three vertices:
2^2 = 1 + s^2 - 2*s*cos(a2)
The respective formulae give:
cos(a1) = (1+s^2-1) / (2*s) = s/2
cos(a2) = (1+s^2-4) / (2*s) = (s^2-3)/(2*s)
Then a1 + a2 must equal 120°.
clearvars,clc
for s=1.7320508075688:.000000000000001:1.73205082
a1=acosd(s/2);
a2=acosd((s^2-3)/(2*s));
fprintf('%16.14f %17.15f\n',s,a1+a2)
if a1+a2<120
break
end
end
is the final stage of the program seeking this equality, and the last two output lines are
s a1 + a2
1.73205080756888 120.000000000000028
1.73205080756888 119.999999999999943
Wolfram Alpha identifies 1.73205080756888 as sqrt(3).
|
Posted by Charlie
on 2024-06-03 09:57:55 |