Home > Backend Development > C++ > What is the area of ​​the square formed by repeatedly joining the midpoints?

What is the area of ​​the square formed by repeatedly joining the midpoints?

WBOY
Release: 2023-09-03 22:21:10
forward
1402 people have browsed it

The area of ​​a square is equal to the product of the side lengths of the square.

We consider a figure in which the midpoint of the sides of each square forms another square. And so on until a specific number of squares.

This graphic shows a square formed by connecting the midpoints of the squares.

What is the area of ​​the square formed by repeatedly joining the midpoints?

For this figure, let the side length be a,

The side length of the internal square will be

L2 = (a/2)<sup>2</sup> + (a/2)<sup>2</sup>
L2 = a<sup>2</sup>(1/4 + 1/4) = a<sup>2</sup>(1/2) = a<sup>2</sup>/2
L = a<sup>2</sup>/ (\sqrt{2}).
Copy after login

The area of ​​square 2 = L2 = a2/2.

For the next square, area of ​​square 3 = a2/4

Let’s give an example, tge

Now we can deduce the area of ​​the continuous squares from here,

a2, a2/2, a2/ 4, a2/8, …..

This is a geometric sequence with a common ratio of ½, where a2 is the first term.

Example

#include <stdio.h>
#include <math.h>
int main() {
   double L = 2, n = 10;
   double firstTerm = L * L;
   double ratio = 1 / 2.0;
   double are = firstTerm * (pow(ratio, 10)) ;
   printf("The area of %lfth square is %lf", n , sum);
   return 0;
}
Copy after login

Output

The area of 10th square is 0.003906
Copy after login

The above is the detailed content of What is the area of ​​the square formed by repeatedly joining the midpoints?. 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