Possible solution would be using the function for the angular distance between two points on a sphere
cos(d) = sin(dec1)sin(dec2) + cos(dec1)cos(dec2)cos(ra1-ra2).
SELECT %(id_field)s, %(ra_field)s, %(dec_field)s
FROM %(schema)s.%(table)s
WHERE ACOS(SIN(RADIANS(%(dec_field)))*SIN(RADIANS(%%(DEC)s))
+ COS(RADIANS(%(dec_field)))*COS(RADIANS(%%(DEC)s))*COS(RADIANS(%(ra_field) - %%(RA)s)))
< RADIANS(%%(SR)s)
LIMIT %(limit)s
https://github.com/django-daiquiri/daiquiri/blob/33094c5389e0acb0b30fcc1db54b7bb6bafaf0c5/daiquiri/conesearch/adapter.py#L102-L109
Possible solution would be using the function for the angular distance between two points on a sphere
cos(d) = sin(dec1)sin(dec2) + cos(dec1)cos(dec2)cos(ra1-ra2)
.