Home > Backend Development > C++ > body text

In a C program, translate the following into Chinese: What is the area of ​​a square inside a circle inscribed in an equilateral triangle?

王林
Release: 2023-09-04 08:57:12
forward
795 people have browsed it

Find the area of ​​a square inscribed in a circle inscribed in an equilateral triangle. The radius of a circle inscribed in an equilateral triangle is a/(2√3).

The diameter of the circle is the diagonal of the square, d = 2 * r = a/ √3

The formula for the area of ​​the square is ½ d2,

A = 0.5 * d2 A = (1/2) * (a2) / (3) = (a2/6)

In a C program, translate the following into Chinese: What is the area of ​​a square inside a circle inscribed in an equilateral triangle?

Example

#include <iostream>
using namespace std;
int main() {
   float area,a = 10;
   area = (a*a) / 6;
   cout <<"area = "<<area<< endl;
   return 0;
}
Copy after login

Output

area = 16.6667
Copy after login

The above is the detailed content of In a C program, translate the following into Chinese: What is the area of ​​a square inside a circle inscribed in an equilateral triangle?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!