Home > Backend Development > C++ > body text

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

王林
Release: 2023-09-13 22:37:04
forward
1443 people have browsed it

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>
Copy after login

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
Copy after login

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;
}
Copy after login

Output

The area is : 50.743439
Copy after login

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!

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