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

Резултати

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

Пребарај: #tectonics

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

@amazingeo · Post #613 · 04.02.2026 г., 20:31

🌍 Some earthquake "swarms" can hit the same spot repeatedly over weeks or months, releasing energy in small bursts instead of one big quake—often in volcanic or tectonic hot zones. ✨ #earthquakes⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #575 · 14.01.2026 г., 12:31

🌍 The planet’s largest earthquake ever measured—a magnitude 9.5—struck Chile in 1960. This event released so much energy it caused land to drop by up to two meters along the coast. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #534 · 24.12.2025 г., 20:31

🌍 One of the fastest-moving tectonic faults is in Turkey, with plates shifting up to 23 millimeters per year. This constant motion makes the region prone to frequent, sometimes devastating earthquakes. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #502 · 08.12.2025 г., 20:31

🌍 Some tectonic plate boundaries move so slowly they create “silent earthquakes”—huge shifts that happen over days or weeks, releasing energy without sudden shaking. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #234 · 14.09.2025 г., 09:12

🌍 Some large earthquakes can trigger aftershocks that last for months or even years. These smaller quakes are part of the Earth’s ongoing adjustment after a major tectonic shift. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #160 · 02.09.2025 г., 03:12

🌍 The strongest earthquakes ever recorded can move entire cities by several meters in seconds. In 2011, Japan’s coastline shifted east by up to 5 meters due to a massive plate boundary quake. ✨ #earthquakes⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #122 · 26.08.2025 г., 20:12

🌍 The San Andreas Fault in California allows two massive tectonic plates to slip past each other. This boundary creeps a few centimeters each year but can unleash powerful earthquakes in sudden jolts. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #466 · 20.11.2025 г., 20:31

🌍 The ring-shaped chain of volcanoes called the "Ring of Fire" circles the Pacific Ocean, hosting about 75% of all active volcanoes on Earth and causing frequent earthquakes and eruptions. ✨ #volcanoes⚡#mountains⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #692 · 16.04.2026 г., 20:31

🌍 The Atlantic Ocean is growing wider each year as the Americas slowly drift apart from Europe and Africa, adding about 2.5 centimeters annually—roughly the speed fingernails grow. ✨ #continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #348 · 08.10.2025 г., 18:31

🌍 The Eurasian and North American continents are moving apart by about 2.5 centimeters every year along the Mid-Atlantic Ridge, slowly widening the Atlantic Ocean over millions of years. ✨ #continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #18 · 10.08.2025 г., 10:27

🌍 The lithosphere’s tectonic plates move slowly, but sometimes collide to form tall mountain ranges like the Himalayas, linking Earth's rocky shell to the atmosphere and biosphere. ✨ #lithosphere⚡#tectonics⚡#mountains⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #194 · 07.09.2025 г., 16:12

🌍 The Himalayas are rising by about 5 millimeters each year as the Indian and Eurasian plates continue to collide. This ongoing uplift makes these mountains among the youngest and fastest-growing on Earth. ✨ #mountains⚡#Himalayas⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

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