rS=(Kx+Ky- (xi'-yi')/(2 KxKy)