Point perspective transformation for javascript