diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-05-26 21:26:40 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-05-29 20:04:30 -0400 |
| commit | 4c986117bfe1f2caa8280d4b0ddbeec69f41b18d (patch) | |
| tree | 76e076b6bc1e331d63252ff30917f0475f24c962 /lib/utils/geometry.py | |
| parent | d50c7e1b99b570ec5300de39c2966ac864700138 (diff) | |
first attempt at realistic rendering
Diffstat (limited to 'lib/utils/geometry.py')
| -rw-r--r-- | lib/utils/geometry.py | 6 |
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) |
