TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #164 · 14 окт.

🙄Разминка для ума! Треугольник Серпинского, интересная фигура которую построить достаточно просто. Алгоритм такой: 1. создаём любые 3 точки на плоскости 2. из этих точек случайно выбираем любую, как начальную 3. случайно выбираем любую точку из этих же трёх точек как цель 4. перемещаемся в сторону цели на половину расстояния 5. повторяем бесконечно с пункта 3 Если сделать достаточно много итераций то вырисовывается интересная фигура. Треугольник, в который вписаны более мелкие треугольники. Это самый настоящий фрактал! Я собрал пример построения такой фигуры на базе Qt. 🌎 Код можно посмотреть здесь. С помощью paintEvent я рисую точки по озвученному алгоритму. Каждые 10 секунд либо по клику на виджете строится следующий треугольник. Особенности примера: 🔸 Атрибут Qt.WA_OpaquePaintEvent позволяет сохранить то, что было нарисовано в прошлой итерации. Таким образом мы видим постепенное наполнение точек а не мелькающую одну точку. 🔸QTimer позволяет создавать отложенные вызовы один раз или с повторением через интервал. 🔸QColor.fromHsv() позволяет создать рандомный но предсказуемый цвет с помощью HSV схемы. Не слишком светлый и не слишком тёмный но всегда с разный. Рандомизации подвергается только смещение по цветовому кругу (Hue), яркость (Value) и насыщенность (Saturation) можно контролировать отдельно в своих пределах или оставить статичными. Обычный рандом цвета по RGB не даёт такой предсказуемый результат. 🔸 Каждый новый цикл с новым треугольником предварительно затемняет предыдущие через этот вызов painter.fillRect(rec, QColor(0, 0, 0, 100)) То есть полупрозрачный цвет. Таким образом, чем старше треугольник, тем он темней. Если сделать виджет фулскрин, то у нас получится некий ScreenSaver))) 🔸 Да, я знаю, что рисование в Qt не самый лучший способ сделать этот пример) Скорее всего самый НЕподходящий. Попробуйте сделать тоже самое но другими средствами. #qt#source#tricks

Резултати

Пронајдени 14 слични објави

Пребарај: #extinction

当前筛选 #extinction清除筛选
Amazing Geography 🌍

@amazingeo · Post #461 · 18.11.2025 г., 12:31

🌍 Since 1970, vertebrate wildlife populations have dropped by an average of nearly 70% worldwide. Habitat loss and pollution are major drivers of this rapid, ongoing global decline. ✨ #environment⚡#extinction⚡#biodiversity⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1381 · 22.04.2026 г., 12:11

🌎 Layers of ancient mud and sand, called sedimentary strata, hold natural records of Earth’s history. These layers show changes in climate, ocean levels, and even mass extinction events over millions of years. The famous K-T boundary, found in rock layers worldwide, marks the asteroid impact that ended the age of dinosaurs about 66 million years ago. ✨ #geology⚡#fossils⚡#extinction 👉subscribe Interesting Planet 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #267 · 19.09.2025 г., 20:12

🌍 Nearly 90% of the world’s wetlands have disappeared since 1700, shrinking vital habitats and reducing natural flood protection for millions of people living downstream. ✨ #wetlands⚡#extinction⚡#flooding⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Interesting Planet 🌍

@interesting_planet_facts · Post #779 · 19.09.2025 г., 03:22

🌎 The Steller’s sea cow, a giant marine mammal, was discovered in the Bering Sea in 1741 and went extinct just 27 years later due to overhunting. This species reached lengths up to 9 meters and fed on kelp, leaving no close living relatives today. ✨ #extinction⚡#megafauna⚡#ocean 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1229 · 16.01.2026 г., 22:11

🌎 Around 252 million years ago, the Permian-Triassic extinction wiped out about 90% of marine species and 70% of land vertebrates. Massive volcanic eruptions in Siberia released greenhouse gases that drove rapid global warming, ocean acidification, and low oxygen levels—making it the largest extinction event in Earth's history. ✨ #extinction⚡#volcanoes⚡#paleoclimate 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #438 · 27.07.2025 г., 16:22

🌎 The Gomphothere, an ancient cousin of elephants, once roamed the Americas with shovel-shaped lower jaws. These extinct giants sported four tusks instead of two, thriving for millions of years before vanishing at the end of the last Ice Age. ✨ #paleontology⚡#megafauna⚡#extinction 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #1346 · 19.03.2026 г., 12:11

🌎 Strange bones found on the island of Malta belong to dwarf elephants and hippos that once lived there. These animals evolved smaller sizes due to limited island resources. The dwarf elephant species Palaeoloxodon falconeri stood just one meter tall at the shoulder. ✨ #extinction⚡#paleontology⚡#Mediterranean 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1209 · 10.01.2026 г., 12:11

🌎 The moa, a group of flightless birds native to New Zealand, stood up to 3.6 meters tall and weighed over 200 kilograms. DNA analysis reveals that moas’ closest relatives are the small, flying South American tinamous, not ostriches or emus as once believed. ✨ #moa⚡#extinction⚡#paleontology 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #843 · 01.10.2025 г., 18:11

🌎 The giant moa, once native to New Zealand, stood up to 3.6 meters tall and weighed about 230 kilograms. Moa vanished around 600 years ago, likely due to hunting by early Polynesian settlers. DNA studies show there were at least nine distinct moa species before extinction. ✨ #moa⚡#extinction⚡#paleontology 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #743 · 13.09.2025 г., 20:22

🌎 The dodo bird, once native to Mauritius, vanished by the late 17th century. Little was documented about its appearance or habits, leaving scientists puzzled. Recent studies of preserved bones and rare historical notes suggest the dodo was likely grayish with small wings and weighed up to 18 kilograms. ✨ #dodo⚡#extinction⚡#mysteries 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1269 · 02.02.2026 г., 22:11

🌎 In Siberia, the woolly mammoth roamed the tundra until about 4,000 years ago. Some frozen mammoth carcasses still contain preserved hair, skin, and even stomach contents. Recent DNA studies show mammoths were closely related to modern Asian elephants. ✨ #mammoth⚡#extinction⚡#Siberia 👉subscribe Interesting Planet 👉more Channels ​

12
ПретходнаСтраница 1 од 2Следна