Home > Backend Development > C++ > body text

In C, the largest Reuleaux triangle inside a square

王林
Release: 2023-09-07 12:29:01
forward
1413 people have browsed it

A Lule Triangle is a shape formed by the intersection of three disks, with the center of each disk on the boundary of the other two disks. Its boundary is a curve of constant width, and apart from the circle itself, it is the simplest and best-known such curve. Constant width means that the spacing between each two parallel support lines is the same, regardless of their orientation. Because all its diameters are the same.

In C, the largest Reuleaux triangle inside a square

The boundary of the Lule triangle is a constant-width curve based on an equilateral triangle. All points on an edge are equidistant from the opposite vertex.

In C, the largest Reuleaux triangle inside a square

Construct a Lule triangle

The formula of Lule triangle

If the curve is based on an equilateral triangle, the side length of the triangle is h , then the area of ​​the Reuleaux triangle is

A = (&pi; * h<sup>2</sup>) / 2 &ndash; 2 * (Area of equilateral triangle) = (&pi; &ndash; &radic;3) * h<sup>2</sup> / 2 = 0.70477 * h<sup>2</sup>
Copy after login

Find the largest Reuleaux triangle inside a square

In C, the largest Reuleaux triangle inside a square

Let us give an example,

Input: a = 6
Output: 25.3717
Copy after login

Explanation

The area of ​​Reuleaux triangle is 0.70477 * b2, where b is the distance between parallel lines Support Reuleaux triangle .

The distance between the parallel lines supporting the Reuleaux triangle = the side length of the square, that is, a

The area of ​​the Reuleaux triangle, A = 0.70477 * a2

##Example

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

Output

The area is : 25.371719
Copy after login

The above is the detailed content of In C, the largest Reuleaux triangle inside a square. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!