Explain the principle of working of a windmill.
A windmill is a machine that converts the energy of wind into rotational energy by means of vanes called sails or blades. The reason for the name "windmill" is that the devices originally were developed for milling grain for food production; the name stuck when in the course of history, windmill machinery was adapted to supply power for many industrial and agricultural needs other than milling. The majority of modern windmills take the form of wind turbines used to generate electricity, or wind pumps used to pump water, either for land drainage or to extract groundwater.