summaryrefslogtreecommitdiff
path: root/lib/utils/geometry.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2018-06-09 21:35:25 -0400
committerGitHub <noreply@github.com>2018-06-09 21:35:25 -0400
commitae940b2466a79b2acc6de5eb33cffb8f7753c701 (patch)
tree5c060aecf2fe345d139387bea4084532acc5c72a /lib/utils/geometry.py
parent1c595c9003d66f49025fa67af838cbdba751449b (diff)
parentb36508bb53512a11dafbc3ecb16944045d88a52a (diff)
Merge pull request #187 from lexelby/lexelby-realistic-rendering
realistic rendering
Diffstat (limited to 'lib/utils/geometry.py')
-rw-r--r--lib/utils/geometry.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/geometry.py b/lib/utils/geometry.py
index 61b98bcb..7ff9b1cd 100644
--- a/lib/utils/geometry.py
+++ b/lib/utils/geometry.py
@@ -71,6 +71,12 @@ class Point:
else:
raise ValueError("cannot multiply Point by %s" % type(other))
+ def __div__(self, other):
+ if isinstance(other, (int, float)):
+ return self * (1.0 / other)
+ else:
+ raise ValueErorr("cannot divide Point by %s" % type(other))
+
def __repr__(self):
return "Point(%s,%s)" % (self.x, self.y)