def to_polar(RAa, RAb, Deca, Decb):
    """ Converts RA/Dec [deg] of two binary components into separation and position angle of B relative 
        to A [mas, deg]
    """
    import numpy as np
    import astropy.units as u
    dRA = (RAb - RAa) * np.cos(np.radians(np.mean([Deca, Decb])))
    dRA = (dRA * u.deg).to(u.mas)
    dDec = Decb - Deca
    dDec = (dDec * u.deg).to(u.mas)
    r = np.sqrt(dRA ** 2 + dDec ** 2)
    p = (np.degrees(np.arctan2(dDec.value, -dRA.value)) + 270.0) % 360.0
    p = p * u.deg
    return r, p
