วงกลมภายในหกเหลี่ยมปกติ มี 6 จุดสัมผัสกับด้านทั้ง 6 ของหกเหลี่ยม
เพื่อหาพื้นที่วงกลมภายใน ต้องหารัศมีก่อน สำหรับหกเหลี่ยมปกติ รัศมีหาได้จากสูตร a(√3)/2
พื้นที่วงกลมภายในคือ 3πa²/4
ตัวอย่าง
ด้านของหกเหลี่ยม = 4
Area = 37.68
โค้ดตัวอย่าง
#include <stdio.h> int main(void) { int a = 14; float pie = 3.14; float area = (float)(3*a*a*pie/4); printf("The area of circle inscribed in the hexagon of side %d is %f", a, area); return 0; }ผลลัพธ์
The area of circle inscribed in the hexagon of side 14 is 461.580017