菱形内切圆与其四个边和四个端点相切。菱形的边与圆相切。
这里,r 是使用 a 和给定值的对角线找到的半径。
现在是面积三角形 AOB = ½ * OA * OB = ½ * AB * r(均使用公式 ½*b*h)。
½ *a/2*b/2 = ½ *( √ (a2/4 + b2/4))*r
a*b/8 = √ (a2+ b2 )*r /4
r = a*b/ 2√ (a2+ b2 )
圆面积 = π*r*r = π*(a2*b2)/4(a2 support>+ b2 )
示例
菱形 5 和 10 的对角线。
面积为 15.700000
示例代码
实时演示
'#include <stdio.h>
int main(void) {
int a = 5; int b= 10;
float pie = 3.14;
float area = (float)((pie*a*a*b*b)/(4*((a*a)+(b*b))));
printf("The area of circle inscribed in the rhombus of diagonal %d and %d is %f",a,b,area);
return 0;
}
输出
'The area of circle inscribed in the rhombus of diagonal 5 and 10 is 15.700000