Home > Backend Development > C++ > body text

What is the largest square inscribed in an equilateral triangle?

WBOY
Release: 2023-08-29 17:37:05
forward
1574 people have browsed it

A planar shape or solid that is inscribedin another geometric shape or solid is enclosed and "fitted tightly" within it. Saying "a square is inscribed in a triangle" means exactly the same thing as "a triangle is circumscribed in a square".

The largest square that can be inscribed in an equilateral triangle−

What is the largest square inscribed in an equilateral triangle?

The largest square that can be inscribed in an equilateral triangle−

Let Let’s take an example,

Input: 5
Output: 2.32
Copy after login

explains that one side of the

square is

x.

Now,

AH is perpendicular to DE.

DE is parallel to BC, angle AED = angle ACB = 60

is in triangle

EFC中,

⇒ Sin60 = x/ EC

⇒ √3 / 2 = x/EC

⇒ EC = 2x/√3

at In triangle

AHE,

⇒ Cos 60 = x/2AE

⇒ 1/2 = x/2AE

⇒ AE = x

Sides of a triangle

AC = 2x/√3 x. Now,

a = 2x/√3 x

x = a/(1 2/√3) = 0.464a

Example

Demonstration

#include <stdio.h>
#include <math.h>
int main() {
   float a = 5;
   float area = 0.464 * a;
   printf("The area is : %f",area);
   return 0;
}
Copy after login

Output

The area is : 2.320000
Copy after login

The above is the detailed content of What is the largest square inscribed in an equilateral triangle?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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