Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления.
from __future__ import division
Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда.
Например:
int/int => int
int/float => float
В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float.
Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float.
12/float(5) => float
Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//".
>>> 3/2
1.5
>>> 3//2
1
То есть теперь деление int на int даёт float если результат не целое число.
В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами.
Данный переход описан в PEP238.
#pep#2to3#basic
🌎 Scientists researching the mysteries of parallel worlds often reference "brane theory," which suggests our universe could be a 3D surface, or 'brane,' floating in higher-dimensional space. In this model, multiple branes—each a universe with its own laws—could exist, and gravity may leak between them, which physicists are testing with experiments at facilities like CERN. ✨
#physics⚡#universe⚡#dimensions
👉subscribe Interesting Planet
👉more Channels
🌎 The concept of "extra dimensions" in physics comes from string theory, which requires at least 10 dimensions for its mathematical consistency. While these extra dimensions could allow for parallel universes, none have been directly detected. Experiments like those at CERN look for signs such as missing energy that might hint at hidden dimensions. ✨
#physics⚡#stringtheory⚡#dimensions
👉subscribe Interesting Planet
👉more Channels
🌎 The concept of higher dimensions beyond the familiar three of space and one of time appears in advanced physics, especially string theory. String theory mathematically requires up to 10 or 11 dimensions to explain gravity and fundamental particles. These extra dimensions are thought to be compact and hidden, possibly curled up at sizes far smaller than atoms. ✨
#dimensions⚡#stringtheory⚡#physics
👉subscribe Interesting Planet
👉more Channels
🌎 In 2022, a study using gravitational wave detectors like LIGO examined whether ripples from colliding black holes hinted at hidden dimensions. The research found no evidence for extra spatial dimensions, setting new constraints on theories that propose parallel universes. ✨
#physics⚡#blackholes⚡#dimensions
👉subscribe Interesting Planet
👉more Channels
🌎 The "brane multiverse" is a scientific idea suggesting our universe might be a three-dimensional "brane" floating in higher-dimensional space. Some versions of string theory propose multiple branes could exist close together, and rare collisions might even trigger new big bangs. The concept arises from efforts to unify gravity with quantum physics. ✨
#multiverse⚡#dimensions⚡#stringtheory
👉subscribe Interesting Planet
🌎 Physicists are searching for evidence of extra dimensions that could exist alongside our three spatial dimensions and time. Experimental efforts, like those at the Large Hadron Collider, look for signs such as missing energy or unusual particle behavior that might indicate the presence of dimensions beyond the familiar four. So far, no direct evidence has been found for extra dimensions. ✨
#physics⚡#dimensions⚡#experiment
👉subscribe Interesting Planet
👉more Channels
Тема шестого дня — картографирование за пределами 2D.
Эту работу подготовил наш коллега @Oreshulya для личного проекта. На карте изображён подводный рельеф небольшого озера Уайтфиш в Канаде. При создании использовалось ПО QGIS для получения картографических данных и Blender 3D для их визуализации.
Основной задачей было показать батиметрические данные в трёхмерном виде, что проблематично сделать с использованием стандартных средств ГИС. Способом изображения для этого была выбрана послойная окраска. Благодаря тому что каждый слой помимо уникального цвета имеет разную высоту в пространстве, создаётся ощущение объёма и глубины, которое на стандартных двумерных батиметрических картах достигается с помощью способа Танака (освещённых горизонталей).
#30DayMapChallenge#Day6#Dimensions#Cartography#GIS