Allow square element to be a rectangle
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import math
|
||||
|
||||
# sign function
|
||||
def sgn(x):
|
||||
if x>=0:
|
||||
@ -20,3 +22,10 @@ def remove_fromlist(a,x):
|
||||
a[a.index(x)]=a[len(a)-1]
|
||||
a=a[:len(a)-1]
|
||||
return a
|
||||
|
||||
# snap to a grid: ceiling
|
||||
def ceil_grid(x,size):
|
||||
return math.ceil(x/size)*size
|
||||
# snap to a grid: floor
|
||||
def floor_grid(x,size):
|
||||
return math.floor(x/size)*size
|
||||
|
Reference in New Issue
Block a user