How to get the real antenna distance and how to calibrate the phase difference?

In AoA calculation, we need r (the range to one of the antennas), d ( the distance between the two antennas) and p (the path difference for the signal arriving at the antennas) to calculate the x, y coordinates of transmitter. We can get r by two way ranging and get p by the PDoA, but how to get the real d?
Before adjusting path difference for antenna effects, I used AoA = arccos(PDoA * WaveLength / 2πd) to get the antenna spacing d. The experimental results show that d varies with the incident Angle of the signal.
So the correct approach should be to first measure the physical distance between the center of antennas to determine d, and then generate a polynomial based on the experimental results to correct PDoA?