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

Function in_bounds

utils/utils_gilbert.py:25–44  ·  view source on GitHub ↗
(x, y, x_s, y_s, ax, ay, bx, by)

Source from the content-addressed store, hash-verified

23
24
25def in_bounds(x, y, x_s, y_s, ax, ay, bx, by):
26
27 dx = ax + bx
28 dy = ay + by
29
30 if dx < 0:
31 if (x > x_s) or (x <= (x_s + dx)):
32 return False
33 else:
34 if (x < x_s) or (x >= (x_s + dx)):
35 return False
36
37 if dy < 0:
38 if (y > y_s) or (y <= (y_s + dy)):
39 return False
40 else:
41 if (y < y_s) or (y >= (y_s + dy)):
42 return False
43
44 return True
45
46
47def 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