Faster way to pick pairs of integer coordinates from a "region"
I am trying to find a faster way to do this than what I have put together or by looping through a bunch of points.I want to select all pairs of integer points ((x1,y1),(x2,y2)) such that:Point (x1,y1)...
View ArticleAnswer by Michael E2 for Faster way to pick pairs of integer coordinates from...
[Update 2: Used Nearest to compute final points pts. Another significant speed up.]The OP's "distance" seems a bit odd and does not obey the triangle inequality. It leads to some odd points. But maybe...
View ArticleAnswer by David G. Stork for Faster way to pick pairs of integer coordinates...
centerpt = {5, 9};r1 = 3;r2 = 1;fullpairs = {};Table[ firstpt = RandomPoint[Circle[centerpt, r1]]; secondpt = RandomPoint[Circle[firstpt, r2]]; If[EuclideanDistance[centerpt, secondpt] >...
View ArticleAnswer by Alucard for Faster way to pick pairs of integer coordinates from a...
i am not sure this is completely right thopc = {229, 256};r1 = 197;r2 = 2;v = {x, y};lista = Select[{x, y} /. Solve[EuclideanDistance[v, pc] == r1, v, Integers], 1 < #[[1]] < 512 && 1...
View ArticleAnswer by Henrik Schumacher for Faster way to pick pairs of integer...
Maybe DiskMatrix is of interest for you. This is not a complete answer, but I try to show how you might apply DiskMatrix to your problem. For example, the set of all points {x1,y1} as specified above...
View ArticleAnswer by george2079 for Faster way to pick pairs of integer coordinates from...
here is a way to do this using region tools:cp = {0, 0}r1 = 10r2 = 3tol = .5annulus[cp_, ri_, ro_] := RegionDifference[Disk[cp, ro], Disk[cp, ri]]p1 = {x, y} /. FindInstance[ Element[{x, y},...
View Article