MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / collides_with

Method collides_with

code/OO/Ball.py:40–45  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

38 self.y = y
39 self.r = r
40 def collides_with(self, other):
41 dx = self.x - other.x
42 dy = self.y - other.y
43 sep = np.sqrt( dx**2 + dy**2 )
44 sum_r = self.r + other.r
45 return sep < sum_r
46
47def run_oo_sim(N, n_iter):
48 box_x, box_y = 10., 6.

Callers 1

run_oo_simFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected