Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
568 B
6
Indexable
Never
def findlink(first, f1, second, s1):
    if len(f1.keys() & s1.keys()) < 66: return []
    for d in f1.keys() & s1.keys():
        (x, y), (m, n) = f1[d], s1[d]
        first_points = set(map(tuple, first))
        for t in ts:
            a = x
            rotated = second * t
            for b in (m * t, n * t):
                delta = a - b
                aligned = rotated + delta
                aligned_points = set(map(tuple, asarray(aligned)))
                if len(first_points & aligned_points) >= 12:
                    return m, t, x
    return False