The locations of stars in the sky are given by their Equatorial coordinates, which are stated as Right Ascension and Declination and given as a pair of numbers (RA, DEC). RA is given in hours, minutes and secionds while Declination is given in degrees.
For math calculations, we want to work in degrees so we convert RA into degrees by multiplying RA x 360/24.0.
Let RA1 and DEC1 be the right ascension and declinations of Star 1 in degrees.
Let RA2 and DEC2 be the right ascension and declination of Star 2 in degrees,
The angular separation A, in degrees, between them is:
Let’s do an example.
Sirius is at RA1=6h 41m and DEC1=-16d 35′ so RA1 = 6.68h x 360/24 = 100.2 degrees and DEC1 = -16.58 degrees.
Betelgeuse is at RA2=5h 50m and DEC2=+7d 23′ so RA2 = 87.5degrees and DEC2 = 7.38 degrees. Then
cos(A) = -0.285x0.128 + 0.958x0.9917 x cos(100.2 - 87.5)
= -0.0364 + 0.9268
= 0.890
so A = 27.1 degrees.