Prev: Combining arrays in a patterned fashion and/or moving rows/columns in a matrix
Next: Strange problem with code of inverse Z transform
From: Ruben on 3 Jul 2010 13:23 I would like two write a function to determine if two circles C1 y C2 centered at points c1 = (x1,y1) and c2 = (x2,y2) and with radios r1 and r2 intersect at any point. ¿Is it enough to calculate the distance between the centers of C1 and C2 and compare it to the sum of their radios? I mean, something like this: function bool = intersecting_circles(r1, c1, r2, c2) % if (r1 + r2 < distance(c1,c2)) bool = 0; else bool = 1; end Any comments are welcomed :-)
From: ImageAnalyst on 3 Jul 2010 14:25
Seems like it should work to me. (By the way, it's "radii" not "radios") |