Point perspective transformation for javscript