
四面体は、三角形の底面を持つピラミッドです。つまり、その底面は三角形で、各辺には三角形があります。 3 つの三角形はすべて 1 つの点に集まります。図に示すように、
四面体の面積 = (√3)a2

##例
四面体を求めますこのコードでは、数学ライブラリを使用して、sqrt メソッドと pow メソッドを使用して数値の平方根と平方根を求めます。面積を計算するには、浮動小数点数を取得し、式「((sqrt(3)*a*a))」の値を与えます。
1 2 3 4 5 6 7 8 9 10 11 | # include <stdio.h>
# include <math.h>
int main() {
int a= 5;
float area, volume;
printf( "Program to find area and volume of Tetrahedron</p><p>" );
printf( "The side of Tetrahedron is %d </p><p>" , a);
area = (sqrt(3)*(a * a));
printf( "The area of Tetrahedron is %f </p><p>" , area);
return 0;
}
|
ログイン後にコピー
出力
1 2 3 | Program to find area and volume of Tetrahedron
The side of Tetrahedron is 5
The area of Tetrahedron is 43.301270
|
ログイン後にコピー
以上が四面体の面積を計算するプログラムの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。