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

Резултати

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

Пребарај: #islands

当前筛选 #islands清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #477 · 01.08.2025 г., 00:22

🌎 The Falkland Islands are home to the only known population of the Cobb’s wren, a small brown bird found nowhere else on Earth. These birds thrive in predator-free habitats, showing how isolated islands can protect unique species from extinction. ✨ #biodiversity⚡#islands⚡#birds 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #706 · 07.09.2025 г., 18:22

🌎 Border oddities abound in Earth’s geography! The Diomede Islands, just 4 km apart in the Bering Strait, belong to different countries and are separated by the International Date Line, meaning they are 21 hours apart in time despite being visible from each other. ✨ #geography⚡#borders⚡#islands 👉subscribe Interesting Planet ​

Bali News

@balinews · Post #206 · 09.10.2024 г., 03:30

🚤Nusa Penida could be home to a floating hospital 🏥 Nusa Penida leaders are proposing a water ambulance service to respond quickly to emergencies. 🚨 There are currently no major hospitals on the islands of Nusa Penida, Nusa Lembongan and Nusa Ceningan near Bali. The small clinics that do exist are unable to treat emergencies and patients have to be brought to Bali by boat or evacuated by helicopter. @BaliNews #goodnews#health#islands

Amazing Geography 🌍

@amazingeo · Post #424 · 30.10.2025 г., 20:31

🌍 One of the youngest islands on Earth, Hunga Tonga-Hunga Haʻapai, formed in 2015 after an undersea volcanic eruption. New land like this is rare and offers scientists a natural laboratory. ✨ #islands⚡#volcanoes⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #465 · 30.07.2025 г., 03:22

🌎 The double coconut palm of Seychelles produces the world’s heaviest seed—up to 18 kilograms! Its giant, heart-shaped seed takes years to mature before dropping to the forest floor. ✨ #botany⚡#islands⚡#wonders 👉subscribe Interesting Planet

Amazing Geography 🌍

@amazingeo · Post #191 · 07.09.2025 г., 03:12

🌍 The Canadian Arctic Archipelago includes over 36,000 islands, making it one of the most complex island groups on Earth. These remote lands are mostly uninhabited and covered by ice much of the year. ✨ #islands⚡#arctic⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #463 · 19.11.2025 г., 12:31

🌍 Canada’s Manitoulin Island is the largest freshwater island in the world. It’s so big that it contains more than 100 lakes, and some of those lakes have islands of their own. ✨ #islands⚡#freshwater⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40702 · 26.02.2026 г., 00:20

The Philippines is an archipelago with about 7,641 islands. Around 2,000 islands are inhabited. More than 5,000 islands are unnamed. The islands are grouped into Luzon, Visayas, and Mindanao. The older count of 7,107 islands was updated after modern surveys. 🇵🇭🏝️🌊 [Read More] @googlefactss #Philippines#Islands#Geography#DidYouKnow#Facts

Amazing Geography 🌍

@amazingeo · Post #103 · 23.08.2025 г., 16:12

🌍 In recent decades, a growing number of small island nations are seeing rising sea levels drive migration, forcing some communities to relocate entirely from their ancestral homes. ✨ #migration⚡#islands⚡#climate⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #336 · 05.10.2025 г., 18:31

🌍 The ancient terraces of the Canary Islands blend natural volcanic slopes with centuries-old farming. These landscapes are so unique they’re recognized globally as a heritage site. ✨ #heritage⚡#agriculture⚡#islands⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #693 · 17.04.2026 г., 20:31

🌍 Indonesia is the world’s largest archipelago, made up of over 17,000 islands. Some, like Java, are densely populated, while others remain so remote they still hold undiscovered plant species. ✨ #archipelago⚡#islands⚡#biodiversity⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

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