function d = QCircleDiam(A, m1, m2, m3, m4)

% This software is from:
%   "Q-factor Measurement by using a Vector Network Analyser",
%   A. P. Gregory, National Physical Laboratory Report MAT 58 (2021)
%
% This software is released under the Creative Commons CC0
%   Public Domain Dedication. You should have received a copy of
%   the Legal Code along with this software.
%   If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
%
% Change log :30-October-2021: Released under CC0.
%
% Return the diameter of the Q-circle
% MAT 58 eqn. (31)

aqratio = m1 + 1j*m2;
b = m1+m3 + 1j*(m2+m4);
d = abs(b - aqratio)*A;
