This is a basic formula in spherical trigonometry applied to the celestial sphere. The distance, r, in radians is given by:
cos(r) = sin(d1)sin(d2) + cos(d1)cos(d2)cos(a1-a2)where a1, d1 are the ra and dec coordinates of Star 1, and a2,d2 are the ra and dec coordinates of Star 2. Note, you have to convert the ra's into radians, and the decs into radians. Example: a1,d1 = 13h 27m and -32d 35' becomes 3.520 and -0.568 radians respectively.