function [A,B]=affine_reflexion(p,q)

% compute the unique affine reflexion X-->AX+B mapping p to q

n=size(p)(1);

v=q-p;

A=eye(n)-(2/(v'*v))*v*v'

m=(1/2)*(p+q)

B=m-A*m

endfunction
