This is a simple javascript code to draw a rectangle and to move it by keeping one side fixed.
It contains two files animation.html and draw.js
Open the animation.html to view.
It contains a rectangle "abdc" with its breadth double than its length. There is a point p on a side say bd (initially at mid point), which can move up, down, right or left with condition that it always remain on the side i.e. point b,p,and d always remain in straight line.
Side bd is rotated in both clockwise and anticlockwise direction about point p with keeping side ac fixed.