summaryrefslogtreecommitdiffstatshomepage
path: root/tests/perf_bench/misc_raytrace.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-02-02 16:11:25 +1100
committerDamien George <damien@micropython.org>2022-02-02 16:49:55 +1100
commitab2923dfa1174dc177f0a90cb00a7e4ff87958d2 (patch)
tree48566c83ba1b6658382c429d39b9f2c8bcc42af2 /tests/perf_bench/misc_raytrace.py
parent326b2c79dfaf472d67e5e3fee5868e78ccc6be73 (diff)
downloadmicropython-ab2923dfa1174dc177f0a90cb00a7e4ff87958d2.tar.gz
micropython-ab2923dfa1174dc177f0a90cb00a7e4ff87958d2.zip
all: Update Python formatting to latest Black version 22.1.0.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/perf_bench/misc_raytrace.py')
-rw-r--r--tests/perf_bench/misc_raytrace.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/perf_bench/misc_raytrace.py b/tests/perf_bench/misc_raytrace.py
index b51acaccac..a729af99c2 100644
--- a/tests/perf_bench/misc_raytrace.py
+++ b/tests/perf_bench/misc_raytrace.py
@@ -22,7 +22,7 @@ class Vec:
return Vec(self.x * rhs, self.y * rhs, self.z * rhs)
def length(self):
- return (self.x ** 2 + self.y ** 2 + self.z ** 2) ** 0.5
+ return (self.x**2 + self.y**2 + self.z**2) ** 0.5
def normalise(self):
l = self.length()
@@ -87,12 +87,12 @@ class Sphere:
def __init__(self, surface, centre, radius):
self.surface = surface
self.centre = centre
- self.radsq = radius ** 2
+ self.radsq = radius**2
def intersect(self, ray):
v = self.centre - ray.p
b = v.dot(ray.d)
- det = b ** 2 - v.dot(v) + self.radsq
+ det = b**2 - v.dot(v) + self.radsq
if det > 0:
det **= 0.5
t1 = b - det
@@ -180,7 +180,7 @@ def trace_ray(scene, ray, depth):
if ndotl > 0:
col += light_col * surf.diffuse * ndotl
if ldotv > 0:
- col += light_col * surf.specular * ldotv ** surf.spec_idx
+ col += light_col * surf.specular * ldotv**surf.spec_idx
# Reflections
if depth > 0 and surf.reflect > 0: