A four-point projective transformation of coordinates using JavaScript