quad and perspective correction?


I am trying to find the q coordinate to have a perspective corrected quad. I don’t understand how to do that? I have find this : http://www.r3.nu/~cass/qcoord/ but it works only if two border are parallel? Is there a formule for a general quad (no parallel border ?).