diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-20 13:37:01 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-20 17:36:48 +0100 |
| commit | 86bca81e753786e0b4e9e9d49e88f0f2a579ebba (patch) | |
| tree | 960d72104b1347b5a2133d5483251181b6ed87f2 /util.py | |
| parent | 11e50657c900543856f3a1f56a96d6c861f55b6e (diff) | |
| download | tdde25-86bca81e753786e0b4e9e9d49e88f0f2a579ebba.tar.gz | |
initial debug drawdebug-draw
Diffstat (limited to 'util.py')
| -rw-r--r-- | util.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +import math + + +def floor_f(f, decimals): + return math.floor(f * 10**decimals) / 10**decimals + + +def to_grid(point, delta=0): + return tuple((floor_f(val, 3) + delta/1000 for val in point)) |
