Home  >  Article  >  Backend Development  >  What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?

What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?

王林
王林forward
2023-09-13 22:37:041386browse

Roulet triangle is a shape formed by the intersection of three disks, with the center of each disk located on the boundary of the other two disks. Its boundary is a curve of constant width, which is the simplest and best-known curve besides the circle itself. Constant width means that every two parallel support lines are equally spaced apart, regardless of their orientation. Because its diameter is the same.

What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?

The boundaries of the Reuleaux triangle are curves of equal width based on the equilateral triangle. All points on a side are equidistant from the opposite vertex.

What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?

Constructing the Reuleaux triangle

Formula of the Reuleaux triangle

The area of ​​the Reuleaux triangle if the curve is based on an equilateral triangle and the sides The triangle is h

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>

The largest Reuleaux triangle within the square, inscribed in the circle

What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?

##Figure 1. The largest Reuleaux triangle within the square, inscribed The area of ​​the largest Reuleaux triangle

within the circle

What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?

is

0.70477 * b2 where b is the distance between the parallel lines supporting the Reuleaux triangle.

The distance between the parallel lines supporting the Reuleaux triangle = the sides of the square, that is,

a

The area of ​​the Reuleaux triangle,

A = 0.70477 * a2

Let’s give an example to better illustrate this concept,

Input: r = 6
Output: 50.7434

Explanation

The side of a square is

a, then

a√2 = 2r

a = √2r

In the Reuleaux triangle,

h = a = √2r,

The area triangle of Reuleaux triangle is,

A = 0.70477*h^2 = 0.70477*2*r^2

Example

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

Output

The area is : 50.743439

The above is the detailed content of What is the translation in C for the largest Ruhr triangle in a square inscribed in a circle?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete