MCPcopy Create free account
hub / github.com/CompVis/zigma / in_bounds

Function in_bounds

utils/utils_zigzag.py:32–51  ·  view source on GitHub ↗
(x, y, x_s, y_s, ax, ay, bx, by)

Source from the content-addressed store, hash-verified

30
31
32def in_bounds(x, y, x_s, y_s, ax, ay, bx, by):
33
34 dx = ax + bx
35 dy = ay + by
36
37 if dx < 0:
38 if (x > x_s) or (x <= (x_s + dx)):
39 return False
40 else:
41 if (x < x_s) or (x >= (x_s + dx)):
42 return False
43
44 if dy < 0:
45 if (y > y_s) or (y <= (y_s + dy)):
46 return False
47 else:
48 if (y < y_s) or (y >= (y_s + dy)):
49 return False
50
51 return True
52
53
54def gilbert_xy2d_r(cur_idx, x_dst, y_dst, x, y, ax, ay, bx, by):

Callers 1

gilbert_xy2d_rFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected