Looking for a way to find solutions for this problem formally and computationally (using program) without pen and paper or plotting.
Find all the ways to arrange four points so that only two distances occur between any two points
In other words, how many ways are there to draw four dots on a piece of paper such that whichever two dots you choose, the distance between these two points is one of two values?
Source : https://www.theguardian.com/science/series/alex-bellos-monday-puzzle
Edit 1: Not looking for the solutions themselves. Looking for the formal and computational approaches to arrive at the solution.
By scaling or permutations of letters (and rotation, translation, etc.), we may require that $A=(0,0)$, and $B=(1,0)$, and another distance $d>1$. Then the following SAGE program lists all such solutions. I will leave the counting problem to you once you get the configurations. (Beware of indentations when you run the program in SAGE.)
def dis((x1,y1),(x2,y2)):
var('x1,y1,x2,y2,d')
S={1,d^2}
for i in S: