In this demo, dozens of declarative constraints are used to represent an arbitrary quadrilateral, the midpoints of the four vertices, and the fact that the end points need to stay in the bounding rectangle of the canvas. Mouse/touch gestures on any of the eight control points allow you to move that control point, and the entire constraint system is incrementally re-solved as you drag the control point. You will see real-time evidence that the "interior" quadrilateral is always a parallelogram.
Tested on Chrome 11 on Windows, Firefox 4.0.1 on Windows, Safari on an iPad 2. See the source to the demo (in CVS).