Предмет: Информатика, автор: markezeegg

30 баллов
помогите пожалуйста

Приложения:

Ответы

Автор ответа: KAM0L0V
0

Ответ:

import turtle

from math import tan, sqrt, pi

def prepare(x, y, color):

   turtle.penup()

   turtle.goto(x, y)

   turtle.pendown()

   turtle.color(color)

   turtle.begin_fill()

def draw_polygon(num_sides, side_length):

   angle = 360.0 / num_sides

   for i in range(num_sides):

       turtle.forward(side_length)

       turtle.right(angle)

   turtle.end_fill()

def calc_s(num_sides, side_length):

   return num_sides * side_length ** 2 / (4 * tan(pi/num_sides))

def calc_side(square):

   return sqrt(4 * square * tan(pi/num_sides) / num_sides)

turtle.hideturtle()

turtle.speed(10)

colors = ['red', 'green', 'blue', 'cyan', 'magenta', 'black', 'yellow', 'pink', 'brown']

xcoords = [0, 150, -150, 150, -150, 270, -270, 270, -270]

ycoords = [0, 150, -150, -150, 150, 270, -270, -270, 270]

squares = []

numsides = []

for i in range(9):

   num_sides = i + 3

   square = round(calc_s(num_sides, 100), 2)

   side_length = round(calc_side(10000), 3)

   squares.append(square)

   numsides.append(num_sides)

   print("Углов:", num_sides, "была площадь:", square, "стала длина грани:", side_length,

         "изменение в", round(side_length/100, 2), "раз")

   prepare(xcoords[i], ycoords[i], colors[i])

   draw_polygon(num_sides, side_length)

turtle.exitonclick()

print("Список количество углов:", numsides, end="")

print("Список площади:", squares)

Объяснение:

Похожие вопросы
Предмет: Английский язык, автор: rigfu
Заполнить пропуски словами и выражениями из таблицы. Изменить форму слова при необходимости.
extended half- brother couple single
stepmother only isolated divorce
nuclear marry introverted generation
common cousin adult selfish
niece nephew bring up

1) People retiring today are more reach than the previous ________.
2) His father and mother ________ when he was 5. That`s why he doesn`t believe in love.
3) It is ________ for children to play in the street.
4) “Do you want to ________ me?” – “Yes, I do”. – she answered with a happy smile.
5) A ________ family consists of a mother, a father and their children.
6) An ________ family consists of all your relatives including aunts, grandparents etc.
7) “Does he have any brothers or sisters?” – No, he is the ________ child.
8) “Did he help you?” – “No, he didn`t. He is very ________ and he thinks only about himself.”
9) They seem to be a happy ________. They are looking romantically at each other all the time.
10) Does he often go out? – No, he is quite ________ and he likes sitting at home.
11) Criminals must be ________ from the society.
12) The new wife of your father is your ________ .
13) “Do you have a ________ or a ________ ?” – “No, my brother doesn`t have any children.”
14) They ________ a son and a daughter.
15) She doesn`t have a husband. She is a ________ parent.
16) “Is she your ________?” – “Yes, she is my uncle`s daughter.”
17) Sometimes it is difficult for ________ to understand children.
18) “ Is he your ________?” – Yes, we have the same mother.
Предмет: Алгебра, автор: ира1062