Zsh, 156 122 bytes
s(){m=
for a b x y;m+=($[(a-x)**2+(b-y)**2])
m=(${(n)m})}
s $=1
n=($m)
s $=2
((r=(n[1]+0.)/m[1],r*m[2]-n[2]||r*m[3]-n[3]))
Try it online!
Try it online!
I believe this is within the rules; there is no calculation done beforehand, simply duplication and re-ordering.
Here is the previous 156 byte answer, which takes the input in a less abusive format. The abusive format removes line 2 in s, and reduces line 3: