This paper presents new and efficient algorithms for matching stellar catalogues where the transformation between the coordinate systems of the two catalagoues is unknown and may include shearing. Finding a given object whether a star or asterism from the first catalogue in the second is logarithmic in time rather than polynomial, yielding a dramatic speed up relative to a naive implementation. Both acceleration of the matching algorithm and the ability to solve for arbitrary affine transformations not only will allow the registration of stellar catalogues and images that are now impossible to use but also will find applications in machine vision and other imaging applications.