| Bytes | Lang | Time | Link |
|---|---|---|---|
| 124 | PARI/GP | 240924T050655Z | alephalp |
| 380 | Python 3 + numpy + scipy | 240920T053305Z | gsitcia |
PARI/GP, 124 bytes
a->if(1<r=#a+1-matrank(concat(a,1^a[,1])),oo,n=#a~;n!/#Set([[[(v=a[s,]-a[t,])*v~|t<-p]|s<-p=numtoperm(n,k)]|k<-[1..n!]])<<r)
Takes input as a matrix where each row is the coordinates of a point.
Let \$d\$ be the dimension of the space, and \$d'\$ be the dimension of the affine subspace spanned by the points. If \$d'<d-1\$, there are infinitely many symmetries. If \$d'=d\$, we can simply count the permutations of the points that preserve distances. If \$d'=d-1\$, we can count the number of such permutations, and then multiply it by \$2\$ to account for reflections.
Python 3 + numpy + scipy, 380 bytes
from itertools import*
from numpy import*
from scipy.linalg import*
def f(p,d,k):
p=array(p)*k-sum(p,0);n=[*null_space(p).T];z=r=0;g=[]
if len(n)>1:return
for i in p:h=[*g,i];s=linalg.matrix_rank(h);g,r=[g,h][r<s],s
for t in permutations(p,int(r)):m=solve(g+n,[*t]+n);z+={*map(tuple,int64(rint(p@m)))}=={*map(tuple,p)}and isclose(m@m.T,identity(d)).all()and 1+len(n)
return z